Skip to content

Instantly share code, notes, and snippets.

@La-comadreja
Last active November 17, 2020 20:33
Show Gist options
  • Save La-comadreja/c4a4b4234c27ed0676de44246c7b2c58 to your computer and use it in GitHub Desktop.
Save La-comadreja/c4a4b4234c27ed0676de44246c7b2c58 to your computer and use it in GitHub Desktop.
%FORMAT String Description
%A full weekday name
%a abbreviated weekday name
%B full month name
%b abbreviated month name
%C (year / 100) as decimal number; single digits preceded by zero
%c national representation of time and date
%D is equivalent to “%m/%d/%y”
%d day of the month as a decimal number (01-31)
%E* %O* POSIX locale extensions
%e day of the month as a decimal number (1-31); single digits preceded by a blank
%G the year containing the greater part of the week (Monday as the first day), with century
%g the same year as in “%G”, but without century (00-99)
%H hour (24-hour clock) as a decimal number (00-23)
%h the same as %b
%I hour (12-hour clock) as a decimal number (01-12)
%j the day of the year as a decimal number (001-366)
%k hour (24-hour clock) as a decimal number (0-23); single digits preceded by a blank
%l hour (12-hour clock) as a decimal number (1-12); single digits preceded by a blank
%M minute as a decimal number (00-59)
%m month as a decimal number (01-12)
%n a newline
%O* the same as %E*
%p “ante meridiem” (a.m.) or “post meridiem” (p.m.) as appropriate
%R is equivalent to “%H:%M”
%r is equivalent to “%I:%M:%S %p”
%S the second as a decimal number (00-60)
%s the number of seconds since the Epoch, UTC (see mktime(3))
%T is equivalent to “%H:%M:%S”
%t a tab
%U the week number of the year (Sunday as day 1 of the week) as a decimal number (00-53)
%u the weekday (Monday as day 1 of the week) as a decimal number (1-7)
%V the week number of the year (Monday as day 1 of the week) as a decimal number (01-53)
%v is equivalent to “%e-%b-%Y”
%W the week number of the year (Monday as day 1 of the week) as a decimal number (00-53)
%w the weekday (Sunday as day 1 of the week) as a decimal number (0-6)
%X the time
%x the date
%Y the year with century as a decimal number
%y the year without century as a decimal number (00-99)
%Z time zone name
%z time zone offset from UTC; hours and minutes with two digits each and no delimiter between
%+ the date and time (the format is similar to that produced by date(1))
%-* GNU libc extension. Do not do any padding when performing numerical outputs
%_* GNU libc extension. Explicitly specify space for padding
%0* GNU libc extension. Explicitly specify zero for padding
%% a %
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment