Custom DateTime Format Strings for .Net
Posted on November 15, 2007 at 15:16I have had to look up on DateTime formatting on MSDN so many times, I have lost track. So I am putting the links and some of the key information here for my own future reference.
- Standard DateTime Format Strings
d/D short/long date f long date, short time F long date, long time g short date, short time G short date, long time t/T short/long time - Custom DateTime Format Strings
d day 1-31 dd day 01-31 ddd abbreviated day name dddd full day name h hour 1-12 hh hour 01-12 H hour 0-23 HH hour 00-23 m minute 0-59 mm minute 00-59 M month 1-12 MM month 01-12 MMM abbreviated month name MMMM full month name s/ss seconds (0/00) t am/pm y/yy year - MS Reporting Services Date Formatting
- Blog post from SteveX on using DateTime.ParseExact