We can add those but those computations would need to be done by the
calendars. We can definitely start with beginning of day and end of day.
PRs welcome!

On Thu, Mar 2, 2023 at 21:26 thia.md...@gmail.com <thia.mdossan...@gmail.com>
wrote:

> Hello, we have Date.beginning_of_month and Date.end_of_month and similar
> functions.
> Would be nice to have other similar helpers to deal with date and datetime.
>
> iex> DateTime.beginning_of_day(~U[2018-11-15 10:00:00Z])
> ~U[2018-11-15 00:00:00Z]
> iex> NaiveDateTime.beginning_of_day(~N[2000-01-01 23:00:07])
> ~U[2000-01-01 00:00:00]
> iex> DateTime.end_of_day(~U[2018-11-15 10:00:00Z])
> ~U[2018-11-15 23:59:59Z]
> iex> NaiveDateTime.end_of_day(~N[2000-01-01 23:00:07])
> ~U[2000-01-01 23:59:59]
>
> There are concerns on the compatibility of these functions between
> different calendars?
>
> What do you think?
>
> --
> 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-core+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elixir-lang-core/3d16c9e2-fda9-46c7-8c76-32a41b14eff4n%40googlegroups.com
> <https://groups.google.com/d/msgid/elixir-lang-core/3d16c9e2-fda9-46c7-8c76-32a41b14eff4n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4%2BTT67%2BqeYD8zyYYWDfVhrg65-VjxpqZX5sZsLgLPsKjw%40mail.gmail.com.

Reply via email to