On Wed, 2004-07-28 at 20:58, Ranga Nathan wrote:

> Is there a quick way to convert a time stamp (date & time)  as seconds 
> since 1900-01-01 00:00:00?
> time() uses 1970 as base (epoch).
> But the system I am dealing with on mainframe uses 1900 as base.
> 
> Looked at Date::Calc and Date::Manip but they  dont seem to handle this.
> 
> Rather than hand-roll some calculations.....huh, I am lazy. That's why I 
> Perl!
> 
> Thanks for any help!

Well, a google search for "seconds in a year" drops into some sort of 
google calculator that says there are 31,556,926 seconds in a year. 
Multiply that by 70 years, and you get an approximate difference 
of 2,208,984,820. Add that constant to a Unix date value, and you'll 
have your corresponding mainframe date value.  

I was going to point out that this doesn't account for leap seconds, 
but after checking google again, I found that the first leap second 
was added to the calendar on June 30, 1972, which means it's not 
relevant to this particular computation. 

-- 
John Abreau / Executive Director, Boston Linux & Unix
Email [EMAIL PROTECTED] / WWW http://www.abreau.net / PGP-Key-ID 0xD5C7B5D9
PGP-Key-Fingerprint 72 FB 39 4F 3C 3B D6 5B E0 C8 5A 6E F1 2C BE 99

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to