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
I'm not a well seasoned javascript programmer but I run the same script side-by-side on my Mac and within a Github codespace and the moment routines returns different results with makes my script useless on Mac. Please advise why this is different. It causes my program to not return proper results running on a Mac.
const startDate = moment(new Date('2023-05-01'));
The above statement running on Mac returns: Sun Apr 30 2023 18:00:00 GMT-0600
Running the same line in a Github codespace returns: Mon May 01 2023 00:00:00 GMT+0600
The text was updated successfully, but these errors were encountered:
I believe your issue is that the timezones are different. Since it seems like the Github codespace is taking the GMT+0600 timezone by default and therefore reports a day ahead.
I'm not a well seasoned javascript programmer but I run the same script side-by-side on my Mac and within a Github codespace and the moment routines returns different results with makes my script useless on Mac. Please advise why this is different. It causes my program to not return proper results running on a Mac.
const startDate = moment(new Date('2023-05-01'));
The above statement running on Mac returns: Sun Apr 30 2023 18:00:00 GMT-0600
Running the same line in a Github codespace returns: Mon May 01 2023 00:00:00 GMT+0600
The text was updated successfully, but these errors were encountered: