is there an UTC mode?
See original GitHub issueThe problem I had is the following. As I’m using CEST timezone the system changes from summer time to winter time (daylight saving time), and I get unexpected results when adding time to my dayjs object. moment has an UTC mode to set the timezone.
I also found that by default moment does this right I’ve attached a failing test. That shows that dayjs is doing different than moment.
test('adding 1 day before changing to daylight summer time', () => {
const dayBeforeSummerTime = '2018-10-28'
expect(dayjs(dayBeforeSummerTime).add(1, 'day')).toEqual(moment(dayBeforeSummerTime).add(1, 'day'))
})
I’ll be glad to help if I can. Thanks in advance
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Coordinated Universal Time - Wikipedia
Coordinated Universal Time or UTC is the primary time standard by which the world regulates clocks and time. It is within about one...
Read more >UTC Time Standard - Time and Date
UTC is a time zone standard used as a basis for all time zones worldwide. It is a constant time scale and does...
Read more >Difference between moment.utc(date) and moment(date).utc()
The first moment.utc(String) parses your string as UTC, while the latter converts your moment instance to UTC mode.
Read more >What is UTC or GMT Time? - National Hurricane Center
Standard Time Standard Time Standard Time Standard Time Standard Time Standar...
UTC Guam HI AK PST MST CST
Diff +10 ‑10 ‑9 ‑8 ‑7 ‑6
00...
Read more >UTC - momentjs.com
Any moment created with moment.utc() will be in UTC mode, and any moment created with moment() will not. To switch from UTC to...
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
DST already supported
@d2bit
Daylight saving time is new to me, I’ll check it.
And for UTC mode, we are working on is, PR #168
Code review or PR is welcome.