This shows you the differences between two versions of the page.
— | dateformat [2008/02/08 19:49] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Formatting the date display on the history page ====== | ||
+ | |||
+ | This is a list of the format specifiers provided by the Date:: | ||
+ | |||
+ | Each conversion specification is replaced by appropriate characters as described in the following list. The appropriate characters are determined by the LC_TIME category of the program' | ||
+ | |||
+ | |||
+ | ===== Time ===== | ||
+ | < | ||
+ | %S seconds, leading 0's | ||
+ | |||
+ | %M minute, leading 0's | ||
+ | |||
+ | %k hour | ||
+ | %l hour, 12 hour clock | ||
+ | %H hour, 24 hour clock, leading 0's) | ||
+ | %I hour, 12 hour clock, leading 0's) | ||
+ | |||
+ | %p AM or PM | ||
+ | %P am or pm (Yes %p and %P are backwards :) | ||
+ | |||
+ | %Z timezone in ascii. eg: PST | ||
+ | %z timezone in format -/ | ||
+ | |||
+ | ===== Date ===== | ||
+ | < | ||
+ | %w day of the week, numerically, | ||
+ | %A day of the week | ||
+ | %j day of the year | ||
+ | |||
+ | %d numeric day of the month, with leading zeros (eg 01..31) | ||
+ | %e numeric day of the month, without leading zeros (eg 1..31) | ||
+ | %o ornate day of month -- " | ||
+ | |||
+ | %G GPS week number (weeks since January 6, 1980) | ||
+ | %U week number, Sunday as first day of week | ||
+ | %W week number, Monday as first day of week | ||
+ | |||
+ | %L month number, starting with 1 | ||
+ | %m month number, starting with 01 | ||
+ | %b month abbr | ||
+ | %B month | ||
+ | %h month abbr | ||
+ | |||
+ | %q Quarter number, starting with 1 | ||
+ | |||
+ | %y year (2 digits) | ||
+ | %Y year (4 digits)</ | ||
+ | |||
+ | ===== Ready-made combinations ===== | ||
+ | < | ||
+ | %C ctime format: Sat Nov 19 21:05:57 1994 | ||
+ | %D MM/DD/YY | ||
+ | %x date format: 11/19/94 | ||
+ | %r time format: 09:05:57 PM | ||
+ | %R time format: 21:05 | ||
+ | %T time format: 21:05:57 | ||
+ | %X time format: 21: | ||
+ | |||
+ | ===== Special Characters ===== | ||
+ | < | ||
+ | %n NEWLINE | ||
+ | %t TAB</ | ||
+ | |||
+ | %d, %e, %H, %I, %j, %k, %l, %m, %M, %q, %y and %Y can be output in Roman numerals by prefixing the letter with " | ||
Should you find anything in the documentation that is incomplete, unclear, outdated or just plain wrong, please let us know and leave a note in the Documentation Forum.