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).
StruxureWare Building Operation Enterprise Server and Automation Server (all models).
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.
There are two workarounds:
- On the Workstation PC, set the PC's time to UTC
- Write code in the Script program to adjust the time values to UTC.