You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a difference in result between what date type you provide when parsing under specific timezone.
This does not seem to be intentional. Let the code speak for itself:
constdateIso='2019-07-03T00:00:00.000Z';// doesn't really matter, could be any ISO8601 dateconstdateObj=newDate(dateIso);// local time (under GMT+3)console.log(dayjs(dateIso).format());// >> 2019-07-03T03:00:00+03:00 ✅console.log(dayjs(dateObj).format());// >> 2019-07-03T03:00:00+03:00 ✅// utcconsole.log(dayjs.utc(dateIso).format());// >> 2019-07-03T00:00:00Z ✅console.log(dayjs.utc(dateObj).format());// >> 2019-07-03T00:00:00Z ✅// timezoneconsole.log(dayjs.tz(dateIso,'Europe/Stockholm').format());// >> 2019-07-03T00:00:00+02:00 ❌ (-2 hours off), why?console.log(dayjs.tz(dateObj,'Europe/Stockholm').format());// >> 2019-07-03T02:00:00+02:00 ✅
Describe the bug
There is a difference in result between what date type you provide when parsing under specific timezone.
This does not seem to be intentional. Let the code speak for itself:
FIY:
moment.js
handles this uniformlyInformation
v1.10.7
The text was updated successfully, but these errors were encountered: