0

Right now I am using UTC as timezone. But I am staying in Bangladesh and It is ahead of 6 hours from server time. I am using a clock as UTC timezone it is also showing me time ahead of 6 hours.

<Clock format={'HH:mm:ss'} ticking={true} timezone={'UTC'} />

Here, I want global timezone. I am in Bangladesh so I will see the bd time, if I am in Russia, then I will see time according to russia. so which timezone to use for that?

  • Your server does not know where the client is located. – Tim Roberts Feb 03 '22 at 18:22
  • Does this answer your question? [Getting the client's time zone (and offset) in JavaScript](https://stackoverflow.com/questions/1091372/getting-the-clients-time-zone-and-offset-in-javascript) – ChiefMcFrank Feb 03 '22 at 18:24

1 Answers1

1

You can use the Intl object of the internationalization API to get the local zone string

const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
Ricardo Sanchez
  • 704
  • 6
  • 21