c# - How can I get this DateTime format in .NET -
I'm trying to format some date times in: -
Full date plus hours and minutes: eg YYYY-MM-DDThh: mmTZD (such as 1997-07-16T19: 20 + 01: 00) where: YYYY = four digit year mm = month of two digits (01 = January, etc.) DD = two digits a month ( 01 to 31) HH = Two points of the hour (00 to 23) (morning / evening is not allowed) mm = minutes (two minutes between) two points (00 to 59) ss = two points of second (00 59) = More points representing the decimal fraction of one or a second TZD = time zone designator (Z or + hh: mm or -hh: mm) I basically Was ... var myDa TeTime = someDateTime.ToString ("s", system globalization.cultureInfo.Invalian culture); But the result is in the string:
2011-08-31T08: 46: 00 Any help?
Use the following:
yourDateTime.ToString (" -MM-DDTH: MMK ", Culture Info. Invertechniculture); More than anything you want to know about datetime formats:
Comments
Post a Comment