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

Timex.format seems off at the end of the month #732

Open
nwittstruck opened this issue Jan 31, 2023 · 0 comments
Open

Timex.format seems off at the end of the month #732

nwittstruck opened this issue Jan 31, 2023 · 0 comments

Comments

@nwittstruck
Copy link

nwittstruck commented Jan 31, 2023

Steps to reproduce

iex> in_5_months = Timex.shift(Timex.now(), months: 5)   
~U[2023-06-30 07:51:27.003055Z]
iex> Timex.format!(in_5_months, "{relative}", :relative) 
"in 4 months"

Description of issue

  • Timex.format seems to miss a month - the result should be "in 5 months", instead of "in 4 months". The output of Timex.shift looks good.
  • It seems the error is only occuring starting recently, it was fine before.
  • At first I thought it was because due to me testing on the 31st. But apparently the issue is not related to the date. I guess it depends if Timex.format does some rounding? Otherwise 5 months - a few secons is already 4 months. It works fine if I add another hour. I'm just curious why it worked before.

Could this be related to this issue? #535

I hope I didn't miss any other open issue related to this. Thank you for the great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant