I would like to get a user's timezone based on the device they are using. I'm aware that doing like, doing the following retrieves me the user's date based on the device they are using:
const dateToday = new Date()
dateToday.setFullYear(dateToday.getFullYear())
I attempted:
const timezone = jstz.determine()
const userTimezone = timezone.name()
But I would like to get back the timezone name in PDT, EST, etc. rather than America/New_York.
And var offset = dateToday.getTimezoneOffset()
only gets me the offset.
So I was wondering in Javascript how to get a user's timezone's name based on the device user?
Thank you
My question is not duplicate
I did give the referred question a try but it only returns the offset in time. What I am looking for is timezone name in PDT, EST, etc. based on the user's device time.