jalaali / moment-jalaali

A Jalaali (Jalali, Persian, Khorshidi, Shamsi) calendar system plugin for moment.js.
MIT License
940 stars 162 forks source link

wrong result #247

Open hamedg68 opened 1 year ago

hamedg68 commented 1 year ago

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 commented 1 year ago

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.