Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: strftime reference

by bmann (Priest)
on Feb 24, 2005 at 18:40 UTC ( #434186=note: print w/replies, xml ) Need Help??


in reply to strftime reference for Win32

holli++ - very useful

For the sake of completeness, here's sample output:

a: Day of Week (short, text) Thu A: Day of Week (long, text) Thursday b: Monthname (short, text) Feb B: Monthname (long, text) February c: Full datetime (number, long) 02/24/2005 12:53:26 PM d: Day (number) 24 H: Hour (24 hour) (number) 12 I: Hour (12 hour) (number) 12 j: Day of year (number) 055 m: Month (number) 02 M: Minutes (number) 53 p: am/pm/empty (text) PM S: Seconds (number) 26 U: Week of Year (number) 08 w: Day of week (number) 4 W: Week of Year (number) 08 x: date (number) 02/24/2005 X: time (number) 12:53:26 PM y: year (short, number) 05 Y: year (long, number) 2005 Z: timezone (text) Pacific Standard Time

Update: This is a Win2K system, Locale set to English(US)

Replies are listed 'Best First'.
Re^2: strftime reference
by holli (Monsignor) on Feb 24, 2005 at 18:44 UTC
    Yes, I did not think of that. Here is the output for a german system.
    a: Day of Week (short, text) Do A: Day of Week (long, text) Donnerstag b: Monthname (short, text) Feb B: Monthname (long, text) Februar c: Full datetime (number, long) 24.02.2005 19:42:04 d: Day (number) 24 H: Hour (24 hour) (number) 19 I: Hour (12 hour) (number) 07 j: Day of year (number) 055 m: Month (number) 02 M: Minutes (number) 42 p: am/pm/empty S: Seconds (number) 04 U: Week of Year (number) 08 w: Day of week (number) 4 W: Week of Year (number) 08 x: date (number) 24.02.2005 X: time (number) 19:42:04 y: year (short, number) 05 Y: year (long, number) 2005 Z: timezone (text) Westeuropäische Normalzeit

    As one can see, %p is empty here, because the locale is set to 24 hours. %x, %X and %c are different too.


    holli, /regexed monk/
Re^2: strftime reference
by Anonymous Monk on Jun 26, 2010 at 02:20 UTC
    Check out http://strfti.me for a very readable online reference and sandbox where you can experiment with different strftime format strings.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://434186]
help
Chatterbox?
[Corion]: Meh. I'm now on Firefox 57 ("Quantum") and again have to remove Pocket, and reinstall the adblocker, uMatrix (because NoScript doesn't work) and silence the about:blank page to not download crap from the internet
[Corion]: Maybe I shouldn't update software ...
[ambrus]: Corion: my guess is to first read the start of the file to check what format it is out of two or more possibilities, then rewind it and handle it differently depending on the program
[ambrus]: s/program/format/
[Dumu]: ambrus: it's about testing a file for being multiple possible file formats
[ambrus]: In particular, you might want to detect the encoding of a HTML file from between utf-16 versus ascii-based and encoding given in a META tag.
[ambrus]: Dumu: it should probably be safe to change the encoding if you rewind first with seek $file, 0, 0 first
[Dumu]: ambrus: good guess. I'm trying to contribute to a CPAN module, and the existing tests assume they're looking at text files
[Dumu]: ambrus: thank you. I was seeking afterwards. I'll seek first.
[jedikaiti]: Hello, Dumu!

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (12)
As of 2017-11-20 17:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (291 votes). Check out past polls.

    Notices?