question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

is there an UTC mode?

See original GitHub issue

The 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'))
})

Edit j1481qw073

I’ll be glad to help if I can. Thanks in advance

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
iamkuncommented, Mar 5, 2019

DST already supported

1reaction
iamkuncommented, Jun 22, 2018

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found