Cicode Programming Reference > Cicode Function Categories > Time and Date Functions Introduction > OLEDateToTime

OLEDateToTime

Converts an OLE DATE value (stored in a REAL) to a CitectSCADA time/date value.

Note: An OLE DATE representing a local time in the daylight savings(DST) to standard time(Std) transition period will be converted to the DST value internally. For example, if the DST transition is 30/3/2003 2:00:00 Std, the local time will behave in the following manner: 2:00:00 DST -> 2:59:59 DST -> 2:00:00 Std. Because of this, a value representing the period between 2:00:00 and 2:59:59 on that date will be interpreted as 2:00:00 DST, not Std.

Syntax

OLEDateToTime(OLEDate, Local)

OLEDate:

The OLE DATE value to convert (stored as a REAL).

Local:

0 - OleDate represents a UTC time.

1 - OleDate represents a Local time.

Return Value

Returns a CitectSCADA time/date value.

Related Functions

TimeCurrent, TimeToOLEDate

Example

Real = TimeToOLEDate(TimeCurrent(), 1);
! Sets Real to the local date/time value
TimeVariable = OLEDateToTime(Real, 1);
! Sets TimeVariable to the value of Real when interpreted as Local time.

See Also

Time/Date Functions