Skip to content

Problem with timezones in react native  #2372

Open
@VictorPulzz

Description

@VictorPulzz

Describe the bug
When I try convert date to select timezone, I got 'Invalid date'.
I know that we can use polyfill from this thread but it's look terrible.

console.log(dayjs('2023-07-11T10:00:00').tz('Australia/Melbourne').format('YYYY-MM-DD HH:mm'));
console.log(dayjs('2023-07-11T10:00:00').tz('Australia/Melbourne').utc().format('YYYY-MM-DD HH:mm'));

got:
image

Expected behavior
Timezone is working on react-native

Information

  • Day.js Version [1.11.7]
  • OS: MacOS m1
  • React-native [0.71.8]
  • Time zone: [not important]

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