Date Formats on Linux


Time Formatting
%H - Hour in 24 hour format (00-23)
%M - Minutes (00-59)
%S - Second (00-61) 61 permits leap seconds.
%I - Hour in 12 hour format. (01-12)
%p - PM or AM
Full Time Formatting
%R - Time in %H:%M
%T - Time in %H:%M:%S
%r - Time in %I:%M:%S %p
Day Formatting
%d - Day of month (01-31)
%e - Day of month (1-31) with single digits padded with space.
%a - Abbreviated weekday
%A - Full weekday
%w - Day of week (Sunday=0)
Month Formatting
%m - Month of year (01-12)
%b - abbreviated month name
%h - Same as %b
%B - Full month name
Year Formatting
%y - Last two digits of year (00-99)
%Y - Four digit year. e.g. 2010
Full Date Formatting
%D - Date in %m/%d/%y
Miscellaneous
%U - Week number in year (00-53). Start week on Sunday.
%W - Week number in year (00-53) - Start week on Monday.
%j - Julian day of year (001-366).
%Z - Time zone name
%x - Country specific date format.
%X - Country specific time format.
%c - Country specfic date and time format. (%a %b %e %T %Z %Y; e.g. Mon 1 Jan 00:01:59 GMT)
%n - Insert newline
%t - Insert a tab

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: