[erlang-bugs] Wrong Gregorian date

Trevor Woollacott [ MTN - Innovation Centre ] <>
Mon Mar 1 15:30:55 CET 2010


Hi Sergei

Date +%s does not return the date and time in Gregorian seconds, rather the number of seconds since 1970-01-01 00:00:00 UTC. If you try to convert the number of seconds since 1970 back to into the date & time tuple it correctly calculates the year at 40AD, which is a leap year.

Regards,
Trevor


-----Original Message-----
From:  [mailto:] On Behalf Of Sergei Fomin
Sent: Monday, 01 March 2010 04:05 PM
To: 
Subject: [erlang-bugs] Wrong gregorian date

Hello.

It seems a part of calendar library thinks there is February 29, 2010.

# date +%s
1267451701

Eshell V5.7.4  (abort with ^G)
1> calendar:gregorian_seconds_to_datetime(1267451701).
{{40,2,29},{13,55,1}}


Best regards,
Sergei Fomin



________________________________________________________________
erlang-bugs (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:


NOTE: This e-mail message is subject to the MTN Group disclaimer see http://www.mtn.co.za/SUPPORT/LEGAL/Pages/EmailDisclaimer.aspx


More information about the erlang-bugs mailing list