iamkun / dayjs

⏰ Day.js 2kB immutable date-time library alternative to Moment.js with the same modern API
https://day.js.org
MIT License
47k stars 2.3k forks source link

Wrong ms conversion #2769

Open valentin78 opened 2 hours ago

valentin78 commented 2 hours ago

Getting issue with parse datetime created small unit test to show the issue

    const ds = '2024-11-18T02:04:48.19';
    expect(dayjs(ds).valueOf()).toEqual(new Date(ds).valueOf());
    // error: Expected 1731913488019 to equal 1731913488190.
valentin78 commented 2 hours ago

PS it works if I parse '2024-11-18T02:04:48.19Z' (i.e. UTC), but fails if local time (w/o timezone)