On 03/15/2011 03:32 PM, Attila Rajmund Nohl wrote:
> Hello!
>> Unfortunately the calendar:* functions crash on wrong input:
>> 1> calendar:datetime_to_gregorian_seconds({{2011,2,30},{1,2,3}}).
> ** exception error: no true branch found when evaluating an if expression
> in function calendar:date_to_gregorian_days/3
> in call from calendar:datetime_to_gregorian_seconds/1
>> So if the input cannot be trusted, there's still some validation to be done.
Ok.
Actually, in my case the input is generated via the erlang:localtime()
function, so I'm sure about its validity.
Loris