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

Changing timezone sets milliseconds to 0 #1002

Closed
fgblomqvist opened this issue Aug 13, 2020 · 3 comments · Fixed by #1003
Closed

Changing timezone sets milliseconds to 0 #1002

fgblomqvist opened this issue Aug 13, 2020 · 3 comments · Fixed by #1003
Labels

Comments

@fgblomqvist
Copy link

Describe the bug

let d = dayjs(1596735327399);
console.log(d.millisecond()); // Will print 399
d = d.tz('America/New_York');
console.log(d.millisecond()); // Will print 0

Expected behavior
Milliseconds should be preserved.

Information

  • Day.js Version: v1.8.33
  • OS: macOS
  • Browser: Chrome 84
  • Time zone: GMT-04:00 DST
@iamkun
Copy link
Owner

iamkun commented Aug 13, 2020

Thanks, Fixed.

@fgblomqvist
Copy link
Author

Wow that was fast, thanks a lot!

iamkun added a commit that referenced this issue Aug 14, 2020
…zone (#1003)

* fix: fix Timezone plugin to preserve milliseconds while changing timezone

fix #1002
iamkun pushed a commit that referenced this issue Aug 20, 2020
## [1.8.34](v1.8.33...v1.8.34) (2020-08-20)

### Bug Fixes

* Fix Timezone plugin to preserve milliseconds while changing timezone ([#1003](#1003)) ([5f446ed](5f446ed)), closes [#1002](#1002)
* support parsing unlimited decimals of millisecond ([#1010](#1010)) ([d1bdd36](d1bdd36)), closes [#544](#544)
* update Duration plugin to support global locale ([#1008](#1008)) ([1c49c83](1c49c83)), closes [#1007](#1007)
@iamkun
Copy link
Owner

iamkun commented Aug 20, 2020

🎉 This issue has been resolved in version 1.8.34 🎉

The release is available on:

Your semantic-release bot 📦🚀

andrewhood125ruhuc added a commit to andrewhood125ruhuc/SidRH2 that referenced this issue May 10, 2022
## [1.8.34](iamkun/dayjs@v1.8.33...v1.8.34) (2020-08-20)

### Bug Fixes

* Fix Timezone plugin to preserve milliseconds while changing timezone ([#1003](iamkun/dayjs#1003)) ([5f446ed](iamkun/dayjs@5f446ed)), closes [#1002](iamkun/dayjs#1002)
* support parsing unlimited decimals of millisecond ([#1010](iamkun/dayjs#1010)) ([d1bdd36](iamkun/dayjs@d1bdd36)), closes [#544](iamkun/dayjs#544)
* update Duration plugin to support global locale ([#1008](iamkun/dayjs#1008)) ([1c49c83](iamkun/dayjs@1c49c83)), closes [#1007](iamkun/dayjs#1007)
andrewhood125ruhuc added a commit to andrewhood125ruhuc/SidRH2 that referenced this issue May 10, 2022
## [1.8.34](iamkun/dayjs@v1.8.33...v1.8.34) (2020-08-20)

### Bug Fixes

* Fix Timezone plugin to preserve milliseconds while changing timezone ([#1003](iamkun/dayjs#1003)) ([5f446ed](iamkun/dayjs@5f446ed)), closes [#1002](iamkun/dayjs#1002)
* support parsing unlimited decimals of millisecond ([#1010](iamkun/dayjs#1010)) ([d1bdd36](iamkun/dayjs@d1bdd36)), closes [#544](iamkun/dayjs#544)
* update Duration plugin to support global locale ([#1008](iamkun/dayjs#1008)) ([1c49c83](iamkun/dayjs@1c49c83)), closes [#1007](iamkun/dayjs#1007)
allmoviestvshowslistsfilmography28 added a commit to allmoviestvshowslistsfilmography28/dayjs that referenced this issue Sep 12, 2024
## [1.8.34](iamkun/dayjs@v1.8.33...v1.8.34) (2020-08-20)

### Bug Fixes

* Fix Timezone plugin to preserve milliseconds while changing timezone ([#1003](iamkun/dayjs#1003)) ([b556484](iamkun/dayjs@b556484)), closes [#1002](iamkun/dayjs#1002)
* support parsing unlimited decimals of millisecond ([#1010](iamkun/dayjs#1010)) ([798cd45](iamkun/dayjs@798cd45)), closes [#544](iamkun/dayjs#544)
* update Duration plugin to support global locale ([#1008](iamkun/dayjs#1008)) ([cf0d414](iamkun/dayjs@cf0d414)), closes [#1007](iamkun/dayjs#1007)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants