Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
The reason that POSIX manual doesn't show the list of escape sequences is that the list depends on your OS. Perhaps you should make it more clear that your program is only of use for Windows users - on my system, I also have:
  • %C: Century number (2 digits)
  • %D: equivalent to %m/%d/%y
  • %e: like %e, leading zero of month replaced with space
  • %E: Modifier alternative format
  • %F: Equivalent to %Y-%m-%d
  • %g: Like %G, but use 2-digit year
  • %G: 4 digit year, but if ISO week belongs to previous year, use previous year.
  • %g: Like %G, but use 2-digit year
  • %h: Equivalent to %b
  • %k: Hours, 0 - 23, single digits preceeded by blank
  • %l: Hours, 1 - 12, single digits preceeded by blank
  • %n: Newline
  • %O: Modifier alternative format
  • %P: As %p, but in lowercase
  • %r: Equivalent to '%I:%M:%S %p'
  • %R: Equivalent to '%H:%M'
  • %s: Number of seconds since epoch
  • %t: Tab character
  • %T: Equivalent to '%H:%M:%S'.
  • %u: Day of week, 1 (Monday) - 7 (Sunday)
  • %V: ISO week number of the year (01 - 53)
  • %z: Time zone as offset of GMT.
  • %%: A % character
  • %+: Time in 'date' format
Here's a program to see what's available on your OS:
#!/usr/bin/perl use strict; use warnings; use POSIX; foreach my $ch ('a' .. 'z', '%', '+') { my $lc = strftime "%\l$ch", localtime; my $uc = strftime "%\u$ch", localtime; for ($lc, $uc) { s/\n/\\n/g; s/\t/\\t/g; } printf "%%%s %25s %25s\n", lc $ch, $lc, $uc; } __END__

In reply to Re: strftime reference by Anonymous Monk
in thread strftime reference for Win32 by holli

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others pondering the Monastery: (5)
    As of 2018-05-20 18:18 GMT
    Find Nodes?
      Voting Booth?