formating date

G

Guest

how to change date format with asp.net 1.1 using c# code like

03/12/1955 00:00:00 to 03/12/1955

thanks can i overload string function like

public override string ToString()
{
return(String.Format("birthDate: {d}", this._BirthDate.ToString()));
}
is that the correct syntax seem not to be as its not working thanks
 
L

Lionel Schiepers

String.Format("{0:dd/MM/yyyy}", DateTime)
or

String.Format("{0:MM/dd/yyyy}", DateTime)


Search the help for DateTimeFormatInfo to have all the possibilities.

Regards,
Lionel Schiepers.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,771
Messages
2,569,587
Members
45,099
Latest member
AmbrosePri
Top