Date Conversion
I Habe a Repeater in the HTML Code. One of Column in there is Birthday. And the Output is this 6/6/1983 12:00:00 AM. My problem is I want to format it in June 6, 1983. In vb.net I know how to format date but in C#.net is not. Somebody Pls help me. Tnx in advance....
Code: <%# DataBinder.Eval(Container.DataItem,"pro_birthday")%>
Aleksey NagogaPosted Oct 24, 2006, 6:10 PM
System.DateTime has a very useful method Parse. Using it makes date parsing extremely easy in any .Net language (C#, VB.Net etc)
all is needed is following:
DateTime dt = System.DateTime.Parse("6/6/1983 12:00:00 AM"); //C#
or
Dim dt as System.DateTime = System.DateTime.Parse("6/6/1983 12:00:00 AM"); 'VB.Net
then use dt's properties such as
dt.Day
dt.Month
dt.Year, etc to manipulate with the date the way you want.
Scott LyslePosted Oct 22, 2006, 2:32 PM
Hope this helps,
Scott Lysle================================= DateTime d = new DateTime(1983, 06, 15); string dt;
dt =
String.Format("{0:MMM dd, yyyy}",d);