date format problem

Results 1 to 2 of 2

Thread: date format problem

  1. #1
    Join Date
    Dec 1969

    Default date format problem

    hi i am trying to print out a date from a sql database using c#<BR><BR> i managed to format the string to certin extent<BR><BR>&#060;%# string.Format("{0:dd/MM/yyyy}", DataBinder.Eval(Container.DataItem, "DateFirstEntered"))%&#062; <BR><BR>but still it prints out like 10/mm/10mm/2002 <BR><BR>why are these mm beeen displayed?

  2. #2
    Join Date
    Dec 1969

    Default RE: date format problem

    I use VB.NET, so take this with a grain of salt. I am wondering if instead of string.Format you need to use:<BR>DateTime.ToString("dd/MM/yyyy") ? <BR><BR>What object are you formatting this for? Does this object have the DataFormatString attribute? If so you can just do:<BR><BR>DataFormatString="{0:dd/MM/yyyy}"&#062;<BR><BR>I hope this helps to get you in the right direction.<BR><BR> - JM<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts