Tuesday, 30 August 2011

DateTime.ToString() custom format

I always forget which letters represent what date/time format in the ToString() method.
Commonly I use it for logging, and the format is:
DateTime.Now.ToString("yyyyMMdd HH:mm:ss:FFFFFF")
, which results in:
20110830 08:22:26:160586
The full list is available here (MSDN)

No comments:

Post a Comment