0

i would like to know if there is any possibility of getting timezone in format: gmt+05:30 delhi chennai mumbai kolkata.i need to do this in javascript and the timezone should be based on browser location.

2 Answers2

1

You can use the getTimezoneOffset() method to return the time difference between UTC time and your local time, in minutes.

Below an example on how to return the timezone difference between UTC and Local Time:

var d = new Date()
var n = d.getTimezoneOffset();
console.log(n);

More information here.

GibboK
  • 71,848
  • 143
  • 435
  • 658
0

The answer to this question is a bit long and requires other libraries to function properly. Have a look at this website: https://css-tricks.com/localizing-times-in-javascript/

Hope it helps! :)

kmugi
  • 343
  • 1
  • 4
  • 13