You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This doesn't make sense to me. UTC refers to an instant in time and looking at the DST rules there is only 1 valid rule for each instant in time. So going from UTC->local time there should not be any ambiguity.
You're right, UTC to local time should never be ambiguous. It looks like there is a bug in localtime:utc_to_local.
However, local time to UTC is ambiguous. If I'm reading the Olson timezone database for London correctly.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule EU 1981 max - Mar lastSun 1:00u 1:00 S
Rule EU 1996 max - Oct lastSun 1:00u 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Europe/London 0:00 EU GMT/BST
This says that the next second after 1:59:59 BST is 1:00:00 GMT, which meant that 1:03 local time occurred twice.
Since the BST/GMT distinction is not represented in Erlang's datetime() representation, local_to_utc(utc_to_local(X)) may produce two datetime()s and utc_to_local(local_to_utc(X)) may fail.
This doesn't make sense to me. UTC refers to an instant in time and looking at the DST rules there is only 1 valid rule for each instant in time. So going from UTC->local time there should not be any ambiguity.
but at UTC 1:03 the local time was definitely 1:03. In fact if you put in 2:03 local time and ask for a UTC conversion you get:
so local_to_utc(utc_to_local(X)) doesn't even round trip.
The text was updated successfully, but these errors were encountered: