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 am in the process of migrating from moment.js to dayjs.js. I am getting unexpected results in a particular use case.
My device is currently using 'America/New_York' timezone and it is ~ 10/22/2024 @ 1:00AM. Meaning it is still the 21st in Los Angeles (3 hours behind me).
moment.js :
dateTZ = 'America/Los_Angeles';
date = moment().tz(dateTZ).startOf('day').format('MMM Do, YYYY [@] h:mm a z');
console.log(date); // returns 'Oct 21st, 2024 @ 12:00 am PDT' - correct
dayjs.js :
dateTZ = 'America/Los_Angeles';
date = dayjs().tz(dateTZ).startOf('day').format('MMM Do, YYYY [@] h:mm a z');
console.log(date); // returns 'Oct 21st, 2024 @ 6:00 am PDT' - wrong
Is there a different way to go about getting the result I am looking for with dayjs or is this just not possible with dayjs?
The text was updated successfully, but these errors were encountered:
I am in the process of migrating from moment.js to dayjs.js. I am getting unexpected results in a particular use case.
My device is currently using 'America/New_York' timezone and it is ~ 10/22/2024 @ 1:00AM. Meaning it is still the 21st in Los Angeles (3 hours behind me).
moment.js :
dayjs.js :
Is there a different way to go about getting the result I am looking for with dayjs or is this just not possible with dayjs?
The text was updated successfully, but these errors were encountered: