Modify Time.utc_now/1 and add Time.utc_now/2 to be consistent with DateTime and NaiveDateTIme

54 views
Skip to first unread message

Neil Lyons

unread,
Mar 25, 2025, 6:37:08 AMMar 25
to elixir-lang-core
Modify Time.utc_now/1 to take calendar_or_time_unit and add Time.utc_now/2 to be consistent with DateTime and NaiveDateTime.

Allowing you to call Time.utc_now/1 and truncate to seconds for example. Like DateTime

Time.utc_now/1
Time.utc_now(Calendar.ISO)
Time.utc_now(:second)

Time.utc_now/2
Time.utc_now(:second, Calendar.ISO)

José Valim

unread,
Mar 25, 2025, 7:16:42 AMMar 25
to elixir-l...@googlegroups.com
Yes, please do submit a PR.


--
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 visit https://groups.google.com/d/msgid/elixir-lang-core/e36783a6-58c3-416b-bc0a-2c7fde746a21n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages