Parsing issue with timezone since 1.10.2
See original GitHub issueDescribe the bug Running v1.9.8:
console.log(dayjs('20170719T112552+0000'))
/*
d {
'$L': 'en',
'$d': 2017-07-19T09:25:52.000Z,
'$x': {},
'$y': 2017,
'$M': 6,
'$D': 19,
'$W': 3,
'$H': 11,
'$m': 25,
'$s': 52,
'$ms': 0
}
*/
Running v1.10.2:
console.log(dayjs('20170719T112552+0000'))
/*
d {
'$L': 'en',
'$d': Invalid Date,
'$x': {},
'$y': NaN,
'$M': NaN,
'$D': NaN,
'$W': NaN,
'$H': NaN,
'$m': NaN,
'$s': NaN,
'$ms': NaN
}
*/
Removing the timezone from the source string and the date is parsed again:
console.log(dayjs('20170719T112552'))
/*
d {
'$L': 'en',
'$d': 2017-07-19T09:25:52.000Z,
'$x': {},
'$y': 2017,
'$M': 6,
'$D': 19,
'$W': 3,
'$H': 11,
'$m': 25,
'$s': 52,
'$ms': 0
}
*/
Looks like the regex (https://github.com/iamkun/dayjs/pull/1307) still need improvement I guess?
Expected behavior Date properly parsed.
Information
- Day.js Version: 1.10.2
- OS: macOS
- Browser: node 12
- Time zone: [e.g. GMT-07:00 DST (Pacific Daylight Time)]
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
How do I interpret and format timestamps in a specific timezone?
Timestamps are assumed to be UTC, or Universal Time Code, and therefore timezone independent. If you need to parse a timestamp with an...
Read more >Parser.parse changes to wrong time zone - Stack Overflow
I parsed the input using re and changed it from: Tue May 01 2018 13:23:00 GMT+0200 (CEST) to Tue May 01 2018 13:23:00...
Read more >Chapter 3. Configuring the Date and Time
This displays the local and universal time, the currently used time zone, the status of the Network Time Protocol ( NTP ) configuration,...
Read more >Telegraf 1.24 release notes - InfluxData Documentation
Update go.mongodb.org/mongo-driver from 1.10.1 to 1.10.2. ... MQTT Consumer input plugin ( inputs.mqtt_consumer ): Topic parsing error when topic having ...
Read more >Apache Avro™ 1.10.2 Specification
Schema Resolution; Parsing Canonical Form for Schemas ... Since the compatibility of two schemas depends on both the data and the ...
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 Free
Top 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

will fix soon
Hi there - is there a timeframe before this is merged? Any help still needed?