The following specifiers and their results are based on the following date:January 3, 0001 A.D., 02:09:20.444 P.M. - thank you MSDN :)
Custom format string Yields-------------------- ------ "%y" "1" "yy" "01" "yyy" "001" "yyyy" "0001" "yyyyy" "00001" "%M" "1" "MM" "01" "MMM" "Jan" "MMMM" "January" "%d" "3" "dd" "03" "ddd" "Wed" "dddd" "Wednesday" "%g" "A.D." "gg" "A.D." "%h" "2" "hh" "02" "%H" "14" "HH" "14" "%m" "9" "mm" "09" "%s" "20" "ss" "20" "%f" "4" "ff" "44" "fff" "444" "ffff" "4440" "fffff" "44400" "ffffff" "444000" "fffffff" "4440000" "%F" "4" "FF" "44" "FFF" "444" "FFFF" "444" "FFFFF" "444" "FFFFFF" "444" "FFFFFFF" "444" "%t" "P" "tt" "PM" "%z" "-8" "zz" "-08" "zzz" "-08:00""'The year is' yyyy" "The year is 0001"""The year is" yyyy" "The year is 0001" "\\" "\"If we format different kinds of DateTime's using "K" DateTimeKind Yields ------------ ------ Unspecified "" Utc "Z" Local "-08:00"
Remember Me
Page rendered at Sunday, August 01, 2010 9:37:36 AM (South Africa Standard Time, UTC+02:00)
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.