-
-
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
is there an UTC mode? #249
Comments
Just stumbled upon this. My date picker has '2018-10-28' twice. xD My solution for now is:
EDIT: For some reason |
@0xsven you can't just add an hour to get proper date because sometimes you must add and sometimes you must remove hour depend on summer time or winter time. |
@neuronetio Also: for some reason, already adding one second solved the problem for me. |
@d2bit, @0xsven, @neuronetio, you initialised the dayjs object with a full local time. You need to remember it, when you're adding or subtracting to/from it. Your scenario is a "date-only" object. The time part is not relevant. However, JavaScript has no Yes, it may not be obvious, that the time part is always there, when you call Day.js could offer an UTC mode, so that if you initialise the dayjs object with UTC, the day will not be converted to the local time zone. But again, remembering how you initialised the object is crucial. Offering a date-only mode would make this scenario clearer. |
@neuronetio this lib supports DST since v1.7.7 |
DST already supported |
🎉 This issue has been resolved in version 1.8.9 🎉 The release is available on: Your semantic-release bot 📦🚀 |
- remove moment-timezone dependency - remove ChatPreview & TransactionListItem snapshots because dayjs does not support UTC iamkun/dayjs#249
Yes, please check. |
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.
I'll be glad to help if I can.
Thanks in advance
The text was updated successfully, but these errors were encountered: