develooper Front page | perl.perl6.language.datetime | Postings from September 2000

Re: RFC 48 (v4) Replace localtime() and gmtime() with date() and utcdate()

Thread Previous | Thread Next
From:
Nathan Wiger
Date:
September 26, 2000 08:20
Subject:
Re: RFC 48 (v4) Replace localtime() and gmtime() with date() and utcdate()
Message ID:
39D0BC6F.AF159447@wiger.org
Jonathan Scott Duff wrote:
> 
> I still think one of the options to the C<date()> routine could be the
> offset from UTC or a code ref to a subroutine that can determine the
> offset given the current UTC. That way the user could specify what
> localtime means (even if it doesn't really mean local time ;-).

Well, you can easily do this already with

   $date = utcdate (time + $offset);

Or even:

   $date = utcdate (time + &getoffset('US/Pacific'));

Or even:

   $date = date (time - &getoffset('UTC'));

Anything having to do with numeric offset it already implicitly
supported (as in Perl 5). And having a date() that returns local time,
which will be most-used, is still a good thing, I think.

-Nate

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About