Home > Software engineering >  Which timezone to use for all users aroung the world?
Which timezone to use for all users aroung the world?

Time:02-04

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?

CodePudding user response:

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

const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
  •  Tags:  
  • Related