-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Unix timestamp is incorrect? #497
Comments
Because in |
Yes, that should parse into local time. But the final conversion back to a Unix timestamp should generate a number at UTC. |
Yes, and that will be of course different. Cause |
What do you not understand? The number that results from |
I'm closing this until I can figure out where the actual bug lies. I'm not really sure what is happening here. |
try UTC plugin |
🎉 This issue has been resolved in version 1.8.9 🎉 The release is available on: Your semantic-release bot 📦🚀 |
if (new Date().getTimezoneOffset() === 0)
thendayjs.unix(1550251173).startOf('day').unix()
returns1550188800
.if (new Date().getTimezoneOffset() === 300)
thendayjs.unix(1550251173).startOf('day').unix()
returns1550206800
.A Unix timestamp is by definition a count of seconds from "00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC)" (http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16). Thus, the correct result should always be
1550188800
.The text was updated successfully, but these errors were encountered: