%Library.Time
Class %Library.Time Extends %DataType [ ClientDataType = TIME, OdbcType = TIME, SqlCategory = TIME, System = 2 ]
The %Time data type class represents a time value.
The logical value of the %Time data type is the number of seconds past midnight.
Parameters
FORMAT;
Parameter FORMAT;
The format specification for the data type's display value. The value of the FORMAT parameter corresponds to the available parameters of the $ZDATETIME
and $ZDATETIMEH
functions, which are used to perform the formatting.
MAXVAL;
Parameter MAXVAL;
The maximum allowed logical value for the data type.
MINVAL;
Parameter MINVAL;
The minimum allowed logical value for the data type.
PRECISION;
Parameter PRECISION;
The number of decimal places of precision to keep for %Time values. If "" then keep whatever precision is provided by the caller.
VALUELIST;
Parameter VALUELIST;
Used for enumerated (multiple-choice) attributes. VALUELIST is either a null string ("") or a delimiter separated list (where the delimiter is the first character) of logical values. If a non-null value is present, then the attribute is restricted to values in the list, and the validation code simply checks to see if the value is in the list.
DISPLAYLIST;
Parameter DISPLAYLIST;
Used for enumerated (multiple-choice) attributes. Used in conjunction with the VALUELIST parameter for enumerated (multiple-choice) attributes. DISPLAYLIST, if not null, represents the display values for the attribute corresponding with the logical values listed in VALUELIST.
The display values are returned by the LogicalToDisplay method.
XMLTIMEZONE
Parameter XMLTIMEZONE [ Constraint = "IGNORE,UTC", Flags = ENUM ] = "UTC";
XMLTIMEZONE specifies the handling of timezone part of the XML format dateTime. "UTC" means convert to UTC on input. "IGNORE means ignore the timezone.
XSDTYPE
Parameter XSDTYPE = "time";
Declares the XSD type used when projecting XML Schemas.
JSONTYPE
Parameter JSONTYPE = "string";
Methods
XSDToLogical
ClassMethod XSDToLogical(%val As %String) As %Time [ CodeMode = generator, ServerOnly = 1 ]
Converts the SOAP encoded input time value into a %Time value.
LogicalToXSD
ClassMethod LogicalToXSD(%val As %Time) As %String [ CodeMode = generator, ServerOnly = 1 ]
Converts the %Time value to the canonical SOAP encoded value.
DisplayToLogical
ClassMethod DisplayToLogical(%val As %String) As %Time [ CodeMode = generator, ServerOnly = 0 ]
Converts the input value %val, which represents a time value, into a logical time value (number of seconds since midnight).
Returns the value of the input string %val as a logical time value (number of seconds since midnight).
IsValid
ClassMethod IsValid(%val As %RawString) As %Status [ CodeMode = generator, ServerOnly = 0 ]
Tests if the logical value %val, which represents a time value (number of seconds since midnight), is valid. The validation is based on the class parameter settings used for the class attribute this data type is associated with. In this case, MAXVAL and MINVAL.
LogicalToDisplay
ClassMethod LogicalToDisplay(%val As %Time) As %String [ CodeMode = generator, ServerOnly = 0 ]
Converts the value of %val, which is a logical time value (number of seconds since midnight), into a display string. The formatting is based on the value of the FORMAT parameter. Returns the formatted value of %val.
LogicalToOdbc
ClassMethod LogicalToOdbc(%val As %Time = "") As %String [ CodeMode = generator, ServerOnly = 1 ]
Converts %val, which represents a logical time value (number of seconds since midnight), into ODBC time format.
Returns the ODBC time string for the logical time value %val.
OdbcToLogical
ClassMethod OdbcToLogical(%val As %String = "") As %Time [ CodeMode = generator, ServerOnly = 1 ]
Converts %val, which represents a time in ODBC format, into a logical time value (number of seconds since midnight).
Returns the logical time value of the ODBC time string %val.
Normalize
ClassMethod Normalize(%val As %RawString) As %Time [ CodeMode = generator, ServerOnly = 1 ]
Converts %val to a normalized value.