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

wrong result #247

Open
hamedg68 opened this issue Mar 28, 2023 · 1 comment
Open

wrong result #247

hamedg68 opened this issue Mar 28, 2023 · 1 comment

Comments

@hamedg68
Copy link

hamedg68 commented Mar 28, 2023

If we have this format 2023-05-08T22:30:00+00:00
and want to formating this string to this format YYYY-MM-DD, the result is 2023-05-09 while I want 2023-05-08 as result . why?

moment('2023-05-08T22:30:00+00:00').format('YYYY-MM-DD'), get this result => 2023-05-09

@behrang
Copy link
Member

behrang commented Apr 2, 2023

Looks like a timezone issue. Since your input time is in UTC (+00:00), I think your machine timezone is in Tehran (+03:30), which changes the date to the next day.

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

2 participants