Unix timestamp is incorrect?
See original GitHub issueif (new Date().getTimezoneOffset() === 0)
then dayjs.unix(1550251173).startOf('day').unix()
returns 1550188800
.
if (new Date().getTimezoneOffset() === 300)
then dayjs.unix(1550251173).startOf('day').unix()
returns 1550206800
.
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
.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
date - Unix timestamp is not correct in JavaScript, but is correct ...
Javascript's timestamps are not standard unix timestamps. They use milliseconds and therefore require a multiplication by 1000:
Read more >Unix time - Wikipedia
Unix time is a date and time representation widely used in computing. It measures time by the number of seconds that have elapsed...
Read more >Timestamps, Time Zones, Time Ranges, and Date Formats
Learn how Sumo Logic manages timestamps, time zones, time ranges, and dates, and the configuration options that are available.
Read more >Timestamp year incorrect : r/Discordjs - Reddit
I pass in the "intraction.guild.createdTimestamp" into <t:timestamp> in a message and this is what it displays. The year is incorrect.
Read more >Spark SQL - Working with Unix Timestamp
_ //Convert Timestamp to Unix timestamp val inputDF ... From the above code, printSchema() and show(false) on DataFrame yields below output.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
🎉 This issue has been resolved in version 1.8.9 🎉
The release is available on:
Your semantic-release bot 📦🚀
Because in
dayjs.unix(1550251173)
, dayjs parses and displays in local time. The same in momentjs.