[erlang-questions] strftime for formatting dates and times

Niclas Eklund <>
Wed Jun 22 10:43:26 CEST 2011


On Tue, 21 Jun 2011, Björn-Egil Dahlberg wrote:

> -record(time, {
>    year   :: integer(),
>    month  :: 1..12,
>    mday   :: 1..31,
>    hour   :: 0..23,
>    min    :: 0..59,
>    sec    :: 0..60,
>    wday   :: 1..7,
>    yday   :: 1..366,
>    is_dst :: -1 | 0 | 1
> }).
>
> Or what would suffice? and timezones?
>
> Just some thoughts.
>
> // Björn-Egil
>

Remember that the UTC offset in some cases exceeds 12, e.g. Line Islands 
(UTC+14:00 - 2011-06-22T08:15:49+14:00) and Tonga (UTC+13:00 - 
2011-06-22T07:15:49+13:00). It can also be off by half an hour/15 minutes, 
e.g. Venezuela (UTC-04:30 - 2011-06-21T13:45:49-04:30) and Nepal 
(UTC+05:45 - 2011-06-22T00:00:49+05:45).

IMHO ISO 8601 notation should be an option, even though it might be a 
"fuzzy".

Best Regards,

Niclas @ Erlang/OTP


More information about the erlang-questions mailing list