Hello co_monks,
I'm a bit puzzeled about the behaviour of different versions of strftime. I got the following code:
use strict;
use POSIX qw(strftime);
print "Perl: $]\n";
print "POSIX: $POSIX::VERSION\n";
my $today = strftime("%d %m %Y %H:%M:%S", gmtime(time));
print 'scalar gmtime: ', scalar gmtime(time), "\n";
print "strftime'd gmtime: $today\n";
$today = strftime("%d %m %Y %H:%M:%S", localtime(time));
print 'scalar localtime: ', scalar localtime(time), "\n";
print "strftime'd localtime: $today\n";
Depending on what Perl version (and POSIX version) I use I get different output for gmtime.
Perl: 5.00503
POSIX: 1.02
scalar gmtime: Tue Jun 14 12:18:04 2005
strftime'd gmtime: 14 06 2005 13:18:04
scalar localtime: Tue Jun 14 14:18:04 2005
strftime'd localtime: 14 06 2005 14:18:04
Perl: 5.008006
POSIX: 1.08
scalar gmtime: Tue Jun 14 12:18:04 2005
strftime'd gmtime: 14 06 2005 12:18:04
scalar localtime: Tue Jun 14 14:18:04 2005
strftime'd localtime: 14 06 2005 14:18:04
Any hints about that? And b.t.w. '12:18:04' is the correct GMT.
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, details, 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, summary, 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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.