Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Inconsistent timezone handling?

    SmartGWT version: 2.4 LPGL
    Browser version: Firefox 4

    - All clients accesing our application are always within the same timezone.
    - The application store dates in UTC in the database.
    - All these UTC datetimes are sent from the server to clients using the following format: yyyy-MM-dd'T'HH:mm:ss+00:00 (e.g: 2011-04-19T22:00:00+00:00).
    - My application starts like:
    Code:
    DateUtil.setDefaultDisplayTimezone("+00:00");
    DateUtil.setAdjustForDST(false);
    - Form controls and ListGrids are populated with UTC datetimes properly. They came in UTC and so they still appear like that on screen.

    Here is the issue:
    - Absolutely all our clients are within one single timezone (GMT+02:00).
    - When I hit save on any form with datetime controls all datetimes are sent to our server rolled back 2 hours.

    Taking into account that:

    - SmartGWT can clearly see that all receiving datetimes are UTC (I attach +00:00 at the end of all of them).
    - I instructed SmartGWT that all dates should be shown in UTC (DateUtil.setDefaultDisplayTimezone("+00:00")), hence, SmartGWT does not alter them in anyway while populating controls. This is completely correct.

    ... then why does it incorrectly rollback all datetimes 2 hours before sending them to the server when they are already UTC? Why does it seem to take into account the client browser´s timezone?

    #2
    Please clarify:

    1) show all the code including whatever code you're using to check / serialize the values

    2) if you're claiming some built-in DataSource operation or similar is encoding in the wrong timezone, show exactly what you see being sent (eg from Firebug).

    Comment

    Working...
    X