Proposal: Deprecate ~U in favour of ~UTC

72 views
Skip to first unread message

Wojtek Mach

unread,
May 16, 2023, 3:59:11 AM5/16/23
to elixir-lang-core
Hi, I'd like to propose deprecating ~U in favour of ~UTC.

I don't think the change would necessarily increase readability of existing code given the common datetime format. I think the advantage is discoverability, if we look at list of available sigils or Kernel functions in general, this one will stand out and be immediately obvious what it does. Another way to look at it, if multi-letter sigils were possible when ~U was introduced, I think it would have been ~UTC all along.

This is just a rename (with deprecation), there's no difference from ~U.

Here's an example:

    ~UTC[2023-01-01 09:00:00Z]

The trailing "Z" is somewhat redundant given we have the ~UTC in front but I think that's OK. Personally, I would not be against dropping it but I haven't thought it through so I'm not advocating for it either.

José Valim

unread,
May 16, 2023, 4:05:50 AM5/16/23
to elixir-l...@googlegroups.com
We discussed it internally and the only concern at the moment is if it won't look inconsistent if we have ~UTC but still keep ~D / ~T / ~N.

--
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 elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/9268db40-e21c-4d8e-b9c9-a5b79f8bb0f9n%40googlegroups.com.

Bruce Tate

unread,
May 16, 2023, 8:06:19 AM5/16/23
to elixir-l...@googlegroups.com
It's only an incremental move in the right direction, but a good one. I am strongly in favor of this proposal. 

-bt

--
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 elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/9268db40-e21c-4d8e-b9c9-a5b79f8bb0f9n%40googlegroups.com.


--

Regards,
Bruce Tate
CEO

Zach Daniel

unread,
May 16, 2023, 9:02:34 AM5/16/23
to elixir-l...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages