I want to get the client machine local timezone.
I tried moment-timezone npm package, with the following command
moment.tz().zoneAbbr()
But it is giving me Universal timezone ie UTC, but I want IST
Can anybody please guide me how to get client machine local time zone.
Intl.DateTimeFormat().resolvedOptions().timeZone will return the client's timezone.
const { timeZone } = Intl.DateTimeFormat().resolvedOptions();
console.log(timeZone);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With