bug in inets or erlang!

Lennart Öhman <>
Wed Nov 30 14:28:09 CET 2005


Not to mention that a function which works for *any* date/time
must also take into account what calendar is to be used.
The gregorian one we use (mostly) in the world today was
invented in the late 16th century. The transition between
the Julian calendar and the Gregorian means removing days.
So it also becomes important to know the "juristiction" you
want to calculate dates for in order to know which local dates
that actually are valid.
In Sweden for instance we did not change until mid 18th century.
And in the beginning of the 18th century "we" actually had a
calendar of our own while trying to go "slowly" over to the
Gregorian calendar. For instance in Sweden the date 1712-02-30
is perfectly alright. It was then decided that since they did
not get anywhere with the reform, it would be better to go back
to the Julian calendar before being able to agree on going to
the Gregorian calendar in one leap.

Not to talk about Russia where the change was not done until after the
revolution.

Best Regards,
Lennart

-------------------------------------------------------------
Lennart Ohman                   office : +46-8-587 623 27
Sjöland & Thyselius Telecom AB  cellular: +46-70-552 6735
Sehlstedtsgatan 6               fax     : +46-8-667 8230
SE-11528, STOCKHOLM, SWEDEN     email   : 
-----Original Message-----
From: 
[mailto:] On Behalf Of Ulf Wiger (AL/EAB)
Sent: den 30 november 2005 10:07
To: Peter Lund
Cc: 
Subject: RE: bug in inets or erlang!


I agree that, given the type of input argument, it's
not obvious why this function should stop working 
before some arbitrary point in time - if it's not 
the beginning of time, but I assume that would be
{{0,0,0},{0,0,0}}.

OTOH, Coordinated Universal Time (UTC) didn't 
exist before 1972, so what would be a correct 
return value before then?

Also time zones haven't always looked the same.
The U.S. introduced four time zones on Nov. 18,
1883. So chances are that any conversion from 
UTC to localtime given very old dates would have
to operate on timezone definitions that didn't 
exist at the time. What, then, is the significance
of the result?

/Uffe 

> -----Original Message-----
> From:  
> [mailto:] On Behalf Of Peter Lund
> Sent: den 30 november 2005 09:46
> To: Claes Wikstrom
> Cc: Peter Lund; ; 
> Subject: Re: bug in inets or erlang!
> 
> Good you have an opionion. Please enlight us!
> 
> I think it is a bug! There is no real reason why this tiny 
> function should be causing crashes even if the caller asks 
> for a valid time and date, any year in the past, for instance 
> the birth of planet earth year some -6 billion or something...
> 
> /Peter
> 
> Claes Wikstrom wrote:
> 
> > Peter Lund wrote:
> >
> >> Yes, the important question here is if:
> >>
> >>  erlang:universaltime_to_localtime({{1969,12,31},{23,59,59}}).
> >>
> >> really should crash the code just because it is 1 sec too early? 
> >> No-one seems to have any opinion about it!
> >>
> >
> > I do :-)
> >
> > /klacke
> >
> 
> 
> 




More information about the erlang-questions mailing list