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

Re: RFC 99 (v3) Standardize ALL Perl platforms on UNIX epoch

Thread Previous | Thread Next
From:
Russ Allbery
Date:
September 13, 2000 21:54
Subject:
Re: RFC 99 (v3) Standardize ALL Perl platforms on UNIX epoch
Message ID:
ylog1rtvyi.fsf@windlord.stanford.edu
Chaim Frenkel <chaimf@pobox.com> writes:

> One other that might be useful is have strftime() (or something similar)
> built-in without having to use POSIX; and the default should be
> YYYYMMDDHHMMSS.fffffff, (the ISO format)

The more commonly-used ISO format is the extended format rather than the
basic one:

    YYYY-MM-DDTHH:MM:SS+ZZZZ

(and yes, the T is part of the format).  More commonly, people use the ISO
extended date format and the ISO extended time format separately with a
space between them and the time zone also separated out:

    YYYY-MM-DD HH:MM:SS +ZZZZ

> I personally prefer to pass around the string representation, more
> that perl and unix systems need to handle datetime. (And I find it
> easier to read the ISO version than a time in seconds)

I agree.  The ISO format is better if you need to write out a date to a
file that you're reading later and you don't need absolutely maximum
speed, particularly if you have good tools to parse it and turn it back
into a native format again.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

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