Differences between DateTime declared as a local variable and as input, output or public in Script program

Issue

The value of DateTime will different depending on how the variable is declared

Product Line

SmartStruxure Solution

Environment

Script

Cause

Lack of understanding how script variables declarations work

Resolution

Local Datetime variables are local and known only  to the Script program or function, and are initialized to the current local date-time value of the sever in which they  execute.

Unlike local variables, Binding variables, including Input, Output and Public variables, are not touched by the Script engine by default. The SBO system uses the 1/1/1970  date, and the Script simply uses that. If one wants to use a different initial value, one can set the initial value and apply it.