>
> To think about it in another way, you lose the information when you do
> `DateTime.to_iso8601`, not in `DateTime.from_iso8601`.  If anything,
> it seems like `DateTime.to_iso8601` should be the controversial,
> disclaimered transformation because this is the lossy point where
> information about the specific locale is lost.
>


The issue is that DateTime.from_iso8601 does not contain enough information
to build a DateTime in the first place. The time_zone field is not
currently allowed to be nil (solution 1) and Etc/GMT+X does not support all
offsets, such as 5.5h, which is a valid offset (solution 2).

So I agree that DateTime.to_iso8601 is controversial (and we have warnings
on its documentation) but at the moment DateTime.from_iso8601 is not
possible. I believe it would only be possible if we convert it to UTC but I
am not sure if it is a valid trade-off in our case.

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4JRivvNsHP_hAkQXRmdogEjzNvqsheZ%2BmPu1prDPLorYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to