Time and Date formats

string Description Example
%A Full weekday name Thursday
%a Abbreviated weekday name Thu
%B Full month name September
%b Abbreviated month name Sep
%C Century (year divided by 100) 20
%c Local representation of time and date Thu Sep 25 22:32:00 2012
%D Equivalent to %m/%d/%y 09/25/12
%d Day of the month as a decimal number (01-31) 25
%e Day of the month as a decimal number (1-31) 25
%F Equivalent to %Y-%m-%d 2012-09-25
%g Same as %G, but as a decimal number with century (00-99) 12
%H Hour (24-hour clock) as a decimal number (00-23) 22
%h Equivalent to %b Sep
%I Hour (12-hour clock) as a decimal number (01-12) 10
%k Hour (24-hour clock) as a decimal number (0-23); single digits are preceded by a blank 22
%l Hour (12-hour clock) as a decimal number (1-12); single digits are preceded by a blank 10
%M Minute as a decimal number (00-59) 32
%m Month as a decimal number (01-12) 09
%p AM or PM pm
%R Equivalent to %H:%M 22:32
%r Equivalent to %I:%M:%S %p 10:32:00 pm
%S Seconds as a decimal number (00-60) 00
%T Equivalent to %H:%M:%S 22:32:00
%v Equivalent to %e-%b-%Y 25-Sep-2012
%X Local representation of time 22:32:00
%x Local representation of date 09/25/12
%Y Year with century as a decimal number 2012
%y Year without century as a decimal number 12