Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Date-Time formats

by SiteDocClan
on Dec 01, 2008 at 04:27 UTC ( #727004=sitefaqlet: print w/ replies, xml ) Need Help??

Most places that display a date-time on the site use your personal timezone (see Timezone Settings) and most of those use one of your personal date-time format strings (see User settings).

The "abbreviated" format for date-times is used when displaying a list (in a table layout). It defaults to "%Y‑%m%8209;%d %H:%M" (where ‑ is a "non-breaking hyphen" to prevent your browser from wrapping after a hyphen in the middle of a date). The result looks like 2008‑11‑30 23:59.

The main (non-abbreviated) date-time format defaults to "%b %d, %Y at %H:%M %Z" which produces results like "Nov 30, 2008 at 23:59 EST".

You can set either format to just "ISO" as short-hand for "%Y‑%m‑%d %H:%M:%S %Z" which looks like "2008‑11‑30 23:59:30 EST" or to "RFC822" for "%a, %d %b %Y %H:%M:%S %z" giving "Sun, 31 Nov 2008 23:59:30 -0800".

The following format strings are supported (mostly just what strftime() supports):

%{ISO}%Y‑%m‑%d %H:%M:%S %Z
%{RFC822}%a, %d %b %Y %H:%M:%S %z
%{short}Your "abbreviated" format string
%YThe (four-digit) year
%mThe two-digit (zero-padded) month number
%dThe two-digit (zero-padded) day-of-month number
%HThe two-digit (zero-padded) hour-of-day (00..23)
%MThe two-digit (zero-padded) minute-of-hour (00..59)
%SThe two-digit (zero-padded) second-of-minute (00..59)
%aThe three-letter day-of-week abbreviation
%bThe three-letter month abbreviation
%ZThe abbreviation for the current timezone (like "EST")
%zThe offset from GMT for the current timezone (like "-0500")
%%A literal '%' character
...... and several other less-common ones.

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2014-12-27 13:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (177 votes), past polls