Article - CS315667

dateFormatISO service returns unexpected time / time zone combination after recent change in DST policy in ThingWorx

Modified: 08-Jun-2020   


Applies To

  • ThingWorx Platform 8.0 to 8.5

Description

  • dateFormatISO service returns unexpected time / time zone combination after recent change in DST policy in ThingWorx
Example
  • Brazil passed a law to scrap daylight saving time (DST) in April 2019
  • DST would have expected to start on the third Sunday in October 2019 at 2019-10-20 00:00:00
  • The switch to DST did not happen due to the policy change
  • See more information for this specific example at https://en.wikipedia.org/wiki/Daylight_saving_time_in_Brazil
  • ThingWorx dateFormatISO(myDate) returns BRST (false)
    • 2019-10-19T00:00:00.000-03:00
    • 2019-10-20T01:00:00.000-02:00
  • JavaScript (myDate).toString returns BRT (correct)
    • Sat Oct 19 2019 00:00:00 GMT-0300 (BRT)
    • Sun Oct 20 2019 00:00:00 GMT-0300 (BRT)
  • Note that the timestamp itself is correct (01:00 GMT-02:00 = 00:00 GMT-03:00), but the formatted time / time zone combination is wrong
This is a printer-friendly version of Article 315667 and may be out of date. For the latest version click CS315667