CalendarTime Operator (FPScript)
Converts an expression into the calendar time data type.
Syntax
CalendarTime Expression
The syntax of the CalendarTime operator consists of the following elements:
Element |
Description |
---|---|
Expression |
Any expression. All data types are permitted. |
Remarks
The operator can process scalar values or entire data series and data matrices. If Expression is a data series or a data matrix, then the type conversion takes place on a per-element basis and the result is once again a data series or a data matrix. If a signal, a signal series or a space curve is converted, only the Y component is examined. The result contains the converted Y component as a data series or data matrix. If Expression is a list, then the operation is executed for each item in the list and the result is also a list.
When converting a numerical value into a calendar time value, this is interpreted as the number of seconds since 1/1/1970 in universal time (UTC). Calendar times before this date are not supported, i.e. calendar times that, when viewed as floating point values, result in a negative value. The transformation of a negative number into a calendar time value therefore results in a void calendar time value. The absolute value is formed for complex data types. Converting a string to a calendar time value depends on Windows Date and Time settings. You should use the format "Month/Day/Year Hour:Minute:Second.fractional digits" or "Day.Month.Year Hour:Minute:Second.fractional digits" and specify a four-digit year. You must use decimal symbol setup in FlexPro Options for the fractional seconds. The Empty type results in a void calendar time value.
If Expression is a quantity, then it has to have the SI dimension of Time and it will be transformed to the unit s before conversion.
Available in
FlexPro View, Basic, Professional, Developer Suite
Examples
CalendarTime 1090929767.0 |
Returns the calendar time value '04/27/2004 14:02:47'. |
CalendarTime "23.12.2004 12:13:14.56" |
Returns '12/23/2004 12:13:14.56'. |
CalendarTime Empty |
Returns '?/?/?'. |
CalendarTime -1 |
Returns '?/?/?'. |
CalendarTime 1090929767.0E+03 ms |
Returns the calendar time value '04/27/2004 14:02:47'. |
See Also
ComplexFloatingPoint32 Operator