Getting the TimeZone string from a Date on IE

10,354

Solution 1

Can this be of service to you?

jsTimezoneDetect

Also this might also be a relevant read: How can I determine a timezone by the UTC offset?

Solution 2

I don't think that there's a way to do what you want reliably in the standard JS date object, but here are some libraries that may help you:

Maybe one of them will give you the info you're looking for.

hope that helps.

Share:
10,354
Mudassir Ali
Author by

Mudassir Ali

Web developer with specialization in Frontend Technologies. Has good sense of UI and UX design. Loves coding in Javascript and Ruby. Familiar with BackboneJS, EmberJS, AngularJS, Ruby on Rails, AWS Opsworks, Selenium.

Updated on July 04, 2022

Comments

  • Mudassir Ali
    Mudassir Ali almost 2 years

    Google Chrome

    new Date()
    //returns Fri Mar 29 2013 17:55:25 GMT+0530 (IST)
    

    IE8

    new Date()
    //returns Fri Mar 29 17:48:46 UTC+0530 2013
    

    I need to extract (IST) part from the Date on IE,On chrome I could do dateString.substring to extract it but on IE I cannot do that.

    The method getTimeZoneOffset gives me the offset in minutes, is there a way to get the string using the offset ?

    Or do I need to research for all the timezone strings corresponding to the offsets and create an object out of it & then use it ?