Announcement

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

    #16
    Originally posted by martintaal View Post
    That if my browser, for example, has a GMT+2, and I receive from the server this:

    Code:
    {
    ...
    startDate: '2014-02-13T10:23:00'
    endDate: '2014-02-13T12:23:00'
    ...
    }
    And I want to avoid they be converted to
    startDate: '2014-02-13 12:23:00+02:00'
    endDate: '2014-02-13 14:23:00+02:00'
    Just to emphasize once again, especially for the many readers who might post yet more erroneous bug reports, no conversion takes place. The values are interpreted as UTC because they have no timezone indicator - this is correct behavior and a best practice.

    If you then *render* the datetime in the current client timezone and that timezone is GMT+2, it will show the correct rendering of the provided UTC datetime in GMT+2: 2 hours later. This again is correct behavior - the only possible behavior - and SmartClient has not changed the datetime value.

    I will have to parse the DataSource response to substract two hours (the client timezone) to the received dates, in order to be able to see the event starting at 10:23:00 and ending at 12:23:00
    You can add or remove these offsets in various ways, one would be to declare the datetime field as String instead so that SmartClient does not parse the value as a datetime at all, and then later parse it yourself and add your offsets.

    And to emphasize once again: the sole reason offsetting like this might be required is because you want to show datetimes from two different timezones in the same page. The need for offsetting never comes up unless this requirement is in place.

    Comment

    Working...
    X