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
The values of dayjs().unix() and dayjs().utc().unix are the same, but dayjs().format('YYYY-MM-DD HH:mm:ss') and dayjs().utc().format('YYYY-MM-DD HH:mm:ss') are different
#2710
Open
XiaoXiaoWu98 opened this issue
Aug 16, 2024
· 3 comments
Describe the bug
The values of dayjs().unix() and dayjs().utc().unix are the same, but dayjs().format('YYYY-MM-DD HH:mm:ss') and dayjs().utc().format('YYYY-MM-DD HH:mm:ss') are different
Expected behavior
The values of dayjs().unix() and dayjs().utc().unix should be different
Information
Day.js Version [e.g. v1.0.0]
OS: [e.g. iOS]
Browser [e.g. chrome 62]
Time zone: [e.g. GMT-07:00 DST (Pacific Daylight Time)]
The text was updated successfully, but these errors were encountered:
Unix time should not be different. After the format you see different "numbers" but omit timezone. In fact it's actually the same date local zone and UTC.
Unix time should not be different. After the format you see different "numbers" but omit timezone. In fact it's actually the same date local zone and UTC.
But if I want to get the UTC timestamp, I can only do it through dayjs().utc().format('YYYY-MM-DD HH:mm:ss').unix(), not directly dayjs().utc().unix(). I think the timestamp should be consistent with the time format after format.
Describe the bug
The values of dayjs().unix() and dayjs().utc().unix are the same, but dayjs().format('YYYY-MM-DD HH:mm:ss') and dayjs().utc().format('YYYY-MM-DD HH:mm:ss') are different
Expected behavior
The values of dayjs().unix() and dayjs().utc().unix should be different
Information
The text was updated successfully, but these errors were encountered: