Knowledge Base
cancel
Showing results for 
Search instead for 
Did you mean: 

Timestamps are incorrect by an amount equal to the UTC offset of the workstation's timezone settings in Script Programs

Issue

Timestamps in Script programs are incorrect by an amount equal to the UTC offset of the workstation's timezone settings. Take the following program as an example:

Datetime Output TimeOut, TimeOut2
TimeOut = StrToDate ("1/17/2012 15:00")
TimeOut2 = StrToDate ("1/17/2012 3:00 PM")

In StruxureWare Building Operation, the values will read:  "1/17/2012 9:00:00 AM" (in this example, the UTC offset is set for -6).

Environment

StruxureWare Building Operation Enterprise Server and Automation Server (all models).

Cause

In StruxureWare Building Operation servers, all time values are stored in UTC, then the offset is applied by the client.  When it receives a value from a Script program, it stores the value as UTC, then the offset for the selected timezone is applied.

Resolution

There are two workarounds:

  1. On the Workstation PC, set the PC's time to UTC
  2. Write code in the Script program to adjust the time values to UTC.
Tags (1)
Labels (1)
Version history
Revision #:
1 of 1
Last update:
3 weeks ago
Updated by: