Skip to content

valueOf function returns the unix timestamp with timezone difference #2833

Open
@veeramani-arthanari

Description

@veeramani-arthanari

Describe the bug
We are replacing all our components using momentjs library with dayjs library.
I'm trying to get the unix timestamp of the given date, but I'm getting the timestamp with timezone difference. For example, I've used the example given here https://day.js.org/docs/en/display/unix-timestamp-milliseconds, as mentioned in example

dayjs('2019-01-25').valueOf()

Expected behavior
As mentioned in the page, it should return the result 1548381600000. But I'm getting 1548354600000 which is 24, Januaray 2019.

Information

  • Day.js Version - 1.11.13
  • OS: MacOS 15.3.1
  • Browser: Chrome 133.0.6943.142
  • Time zone: GTM+05:30 (Indian Standard Time)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions