[Proposal] NaiveDateTime.add/3 accepting more units

21 views
Skip to first unread message

Renato Ceolin

unread,
Jul 29, 2020, 1:37:32 PM7/29/20
to elixir-lang-core

It would be nice if NaiveDateTime accepted more units other than
:second, :millisecond, :microsecond and :nanosecond.

Actually it is more like adding more units to https://hexdocs.pm/elixir/System.html#t:time_unit/0

Having :minute, :hour, :day:, :week, :month, :year would be nice

José Valim

unread,
Jul 29, 2020, 1:45:17 PM7/29/20
to elixir-l...@googlegroups.com
There has been recent discussions on this mailing list and on the issues tracker about this. So I recommend searching for the previous discussion. The issue is here: https://github.com/elixir-lang/elixir/pull/10199

TL;DR - the nuances of timezones, multiple calendars, etc make this more complicated than one would expect.

--
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/bf5a1fe5-fe2a-4e88-9380-c343704e73b5n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages