Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: preserve datetime precision after Timex.shift/2 #741

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Apr 26, 2023

  1. Fix: preserve datetime precision after Timex.shift/2

    Resolves bitwalker#731
    
    Unfortunately this broke with elixir-lang/elixir@5a583c7
    which was release with Elixir 1.14.3
    
    Elixir 1.13.4:
    
    ```
    iex(3)> DateTime.utc_now() |> IO.inspect() |> DateTime.truncate(:second) |> IO.inspect() |> Timex.shift(minutes: 1) |> IO.inspect()
    ~U[2023-04-13 09:56:10.136274Z]
    ~U[2023-04-13 09:56:10Z]
    ~U[2023-04-13 09:57:10Z]
    ```
    
    Elixir 1.14.4:
    
    ```
    iex(1)> DateTime.utc_now() |> IO.inspect() |> DateTime.truncate(:second) |> IO.inspect() |> Timex.shift(minutes: 1) |> IO.inspect()
    ~U[2023-04-13 09:55:16.405357Z]
    ~U[2023-04-13 09:55:16Z]
    ~U[2023-04-13 09:56:16.000000Z]
    ```
    tfiedlerdejanze committed Apr 26, 2023
    Configuration menu
    Copy the full SHA
    4c00c0b View commit details
    Browse the repository at this point in the history