On Mon, 16 Oct 2000, David E. Wheeler wrote:
> Hi All,
>
> Can anyone tell me why these are not equivalent? Shouldn't strftime know
> that the time returned from gmtime() is GMT? I'm trying to create a
> library that'll use ht_time when $ENV{MOD_PERL} is true, ans strftime
> otherwise. But they need to be consistent!
>
> use Apache::Util 'ht_time';
> my $t = ht_time;
> print "$t\n"; # prints "Mon, 16 Oct 2000 20:33:42 GMT"
>
> use POSIX 'strftime';
> my $a = strftime("%a, %d %b %Y %T %Z", gmtime);
> print "$a\n"; # prints Mon, 16 Oct 2000 21:33:42 PDT
Sadly gmtime doesn't return any component indicating the timezone. Of
course why not print out GMT instead of %Z?
Alternatively, why not use Time::Object? It implements strftime without
the overhead of POSIX.pm, and does it in XS too.
--
<Matt/>
/|| ** Director and CTO **
//|| ** AxKit.com Ltd ** ** XML Application Serving **
// || ** http://axkit.org ** ** XSLT, XPathScript, XSP **
// \\| // ** Personal Web Site: http://sergeant.org/ **
\\//
//\\
// \\