javascripttimezonemomentjsmoment-timezoneangular-moment

Get timezone from users browser using moment(timezone).js


What is the best way to get client's timezone and convert it to some other timezone when using moment.js and moment-timezone.js

I want to find out what is clients timezone and later convert his date and time into some other timezone.

Does anybody has experience with this?


Solution

  • var timedifference = new Date().getTimezoneOffset();
    

    This returns the difference from the clients timezone from UTC time. You can then play around with it as you like.