Results 1 to 8 of 8

Thread: IE ignores timezone in parseDate

  1. #1
    Sencha Premium Member
    Join Date
    Jan 2008
    Location
    Atlanta, GA
    Posts
    93

    Default IE ignores timezone in parseDate

    I'm working on an app that needs all times to be in a certain timezone (EST) regardless of the user's timezone (because of legacy code on the server). I tried adding a 'T' and cooresponding 'EDT' to the Date.parseDate method I'm using to retrieve a date object which works in FF but not in IE6 (or 7) and I wondered if anyone else had run across this issue and/or knew of a solution.

    I've also tried 'O' using '-0400' but that didn't work either. It's almost as if IE completely ignores any timezone data and overrides with the system timezone.

    Any help will be much appreciated.

    -Wes

  2. #2
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236

    Default

    post your code.

  3. #3
    Sencha Premium Member
    Join Date
    Jan 2008
    Location
    Atlanta, GA
    Posts
    93

    Default

    Date.parseDate('04/19/2010 5:00 PM EST', 'm/d/Y g:i A T');
    If you run this from a FF browser in a different timezone (I've been simply changing the system time), it correctly converts the date to EST. However IE (6 and 7) override it with the local timezone.

    We are also using 2.2.0 and I haven't checked whether this is one of the issues fixed in 2.2.1.

  4. #4
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236

    Default

    by "timezone", are you referring to the 3/4 letter code (e.g EST), or are you referring to the timezone offset (e.g. -0400).

    you could, if you wanted, simply drop the 2.2.1 Date.js in in place of 2.2.0's -- just to test of course.

  5. #5
    Sencha Premium Member
    Join Date
    Jan 2008
    Location
    Atlanta, GA
    Posts
    93

    Default

    I'm referring to the 3/4 letter code 'EST'. What I expected (and what happens in FF and Chrome) is for the date to be converted into the desired timezone regardless of the timezone the user's browser is in.

  6. #6
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236

    Default

    that's actually out of anyone's control -- all browsers impose their own timezone settings on the js engine. in other words, all js Date objects will always inherit, and be expressed in terms of, the browser's timezone settings -- there's simply no way about this.

    all browsers also display different timezone strings -- see my comments in the Date.js source.

    [edit]
    if the timezone offset is off though then it would be a bug.
    fyi, the 3/4 letter timezone delimiter plays absolutely no part in determining the timezone offset.
    Date.parseDate() simply ignores that.
    Last edited by mystix; 5 Jun 2009 at 5:24 AM. Reason: edit

  7. #7
    Sencha Premium Member
    Join Date
    Jan 2008
    Location
    Atlanta, GA
    Posts
    93

    Default

    I've tried using the 'O' format with '-0400' for EST but got the same result. Is there any way (outside of manually adjusting for the desired timezone) to force the browser to parse into a foreign timezone?

  8. #8
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236

    Default

    like i mentioned above, there is absolutely no way to change the browser's timezone through the js engine.

    to be certain we're both on the same page though (cos i think either of us might be misinterpreting parts of our conversation), could you post your example code, along with the actual and expected outputs from IE6/7/8 / Chrome / Firefox?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •