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

DayJS Timezone Does Not Accept UTC (Zulu) Timestamp as Argument #1273

Open
ChildishDanbino opened this issue Dec 14, 2020 · 2 comments
Open

Comments

@ChildishDanbino
Copy link

ChildishDanbino commented Dec 14, 2020

Describe the bug
Hey! Just first things first I want to say thanks for the library. Our team is in the process of getting rid of momentJS across the whole app and we are attempting to convert fully over to dayJS but ran into this issue today.

In Moment-Timezone you can pass a timestamp as follows using the Zulu format and an olson timezone to convert a date.

moment.tz("2020-12-14 19:58:00.000Z", 'America/New_York').format()
// returns 2020-12-14T14:58:00-05:00

DayJS appears to be ignoring the "Z" formatting:

 dayjs.tz('2020-12-14 19:58:00.000Z', 'America/New_York').format()
// returns 2020-12-14T19:58:00-05:00

Expected behavior
I would expect the output of dayJS and MomentJS this to be the same given the same input. There might be a DayJS Method we could use to get the same result but I am currently unaware of it.

Information

  • Day.js Version: 1.9.7
  • OS: Mac OS Mojave 10.14.6
  • Browser [e.g. chrome 62]
  • Time zone: US Eastern Standard Time (EST -5:00)
@chengB12
Copy link

chengB12 commented Jan 4, 2021

Probably same as #1265

@ghiscoding
Copy link

or this other issue #1358 that got fixed but is not working in strict mode

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

3 participants