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:
Chaim Frenkel
Date:
September 13, 2000 21:12
Subject:
Re: RFC 99 (v3) Standardize ALL Perl platforms on UNIX epoch
Message ID:
m3em2na9xu.fsf@csamnycln01.nyc.csam.com
>>>>> "AD" == Andy Dougherty <doughera@lafayette.edu> writes:

AD> In my humble opinion, I think perl's time() ought to just call the C
AD> library's time() function and not waste time mucking with the return
AD> value.  Instead, if the time is to be stored externally for later use by
AD> another program, the programmer should be responsible for converting the
AD> time into a suitably useful and portable format.  Any unilateral choice
AD> made by Perl6 in that regard isn't going to be of any help unless everyone
AD> else (Java, Python, C, etc.) follows along.

Possibly a few functions to make it easy.

$Perl::EpochOffset	

	0 		on a unix box
	966770660	on a Mac (Lifted from pudge's previous email)
	etc.

Then on output. print time()-$Perl::EpochOffset;

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)

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)

<chaim>
-- 
Chaim Frenkel					     Nonlinear Knowledge, Inc.
chaimf@pobox.com				               +1-718-236-0183

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