Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Time zone support is wrong. #8

vlm opened this Issue Dec 30, 2012 · 3 comments


None yet
3 participants

vlm commented Dec 30, 2012

According to ISO8601, the time zone is represented either by ±HH, or ±HHMM, or by a single letter 'Z' for UTC.

In the code a simple %z is used, which omits the '±' delimiter. This is wrong and has to be corrected.

convert_format(iso8601) -> <<"%Y-%m-%dT%H:%M:%S%z">>;

@ghost ghost assigned superbobry Dec 30, 2012


superbobry commented Jan 3, 2013

%z takes care of ± delimiter, at least that's what the manpage is saying:

%z is replaced by the time zone offset from UTC; a leading plus sign stands for east of UTC,
a minus sign for west of UTC, hours and minutes follow with two digits each and no delimiter
between them (common form for RFC 822 date headers).

However, it seems, that libc doesn't support Z and expects an empty string for UTC.

vlm commented Jan 4, 2013

Perhaps, but in the README there's the following clause:

(tempo_dev@localhost)1> {ok, Bin} = tempo:format(iso8601, {now, now()}). {ok,<<"2012-06-01T19:06:420000">>}

Which clearly shows there's no ±. Why is that?

@superbobry superbobry closed this in 4c8bb4b Jan 5, 2013


si14 commented Jan 6, 2013

Thanks for contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment