Formatting the date display on the history page

This is a list of the format specifiers provided by the Date::Format module:

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's locale.

Time

%s      seconds since the Epoch, UCT
%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 -/+0000

Date

%a      day of the week abbr
%w      day of the week, numerically, Sunday == 0
%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 -- "1st", "2nd", "25th", etc.

%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      MM/DD/YY HH:MM:SS
%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:05:57

Special Characters

%%      PERCENT
%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 “O”, e.g. %OY will output the year as roman numerals.

 
dateformat.txt · Last modified: 2008/02/08 19:49 by 127.0.0.1

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.

Recent changes RSS feed Donate Driven by DokuWiki
The content of this wiki is protected by the GNU Fee Documentation License