[Brisbane-pm] Times and Dates

Paul Fenwick pjf at perltraining.com.au
Thu Sep 6 06:23:58 PDT 2007


G'day Martin,

Martin Jacobs wrote:

[snip]

> My problem is that the output goes wrong for dates before 01/Jan/1970 
> 00:00:00 (I think, when timevalue in seconds-since-epoch is 0). Some of 
> my timeseries may run to 1900, or even earlier, but the sub above 
> refuses to generate a consequential series (1901, for example, gets 
> interpreted as 2001).

You haven't mentioned *which* timegm() you're using.  There are at least two 
floating around.  One you may gain using:

	use POSIX qw(timegm);

and has its roots in BSD.  The other you'd obtain with:

	use Time::Local qw(timegm);

and is a pure perl implementation.  As a first try I'd start by seeing if 
the other implementation from what you're using gives you more joy.  Be 
aware that the POSIX version may be implemented differently on different 
systems.

Cheerio,

	Paul

-- 
Paul Fenwick <pjf at perltraining.com.au> | http://perltraining.com.au/
Director of Training                   | Ph:  +61 3 9354 6001
Perl Training Australia                | Fax: +61 3 9354 2681


More information about the Brisbane-pm mailing list