Class Reference
IRIS for UNIX 2024.1.2
InterSystems: The power behind what matters   
Documentation  Search
  [USER] >  [%Library] >  [Date]
Private  Storage   

datatype class %Library.Date extends %DataType

ODBC Type: DATE

The %Date data type class represents a date. The logical value of the %Date data type is in InterSystems IRIS $H format.

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
7 10


Summary

Methods
DisplayToLogical IsValid JSONToLogical LogicalToDisplay
LogicalToJSON LogicalToOdbc LogicalToXSD Normalize
OdbcToLogical XSDToLogical

Subclasses
%DeepSee.Datatype.dateTime %xsd.date

Parameters

• 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.

• 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 $ZDATE and $ZDATEH functions, which are used to perform the formatting.
• parameter JSONTYPE = "string";
• parameter MAXVAL;
The maximum allowed logical value for the data type.
• parameter MINVAL;
The minimum allowed logical value for the data type.
• 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.
• parameter XSDTYPE = "date";
Declares the XSD type used when projecting XML Schemas.

Methods

• classmethod DisplayToLogical(%val As %String) as %Date
Converts the input value %val, which represents a date, into $H format.

Returns the logical ($H) value of the input string %val.

• classmethod IsValid(%val As %RawString) as %Status
Tests if the logical value %val, which represents a date in $H format, 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.
• classmethod JSONToLogical(%val As %String) as %Date
Converts the JSON input date value into a %Date value.
• classmethod LogicalToDisplay(%val As %Date) as %String
Converts the value of %val, which is in logical $H format, into a display string. The formatting is based on the value of the FORMAT parameter.

Returns the formatted value of %val.

• classmethod LogicalToJSON(%val As %Date) as %String
Converts the %Date value to the canonical JSON value.
• classmethod LogicalToOdbc(%val As %Date = "") as %String
Converts %val, which represents a date in logical $H format, into ODBC date format.

Returns the ODBC date string for the logical ($H) value %val. Assume if the value is already in ODBC DATE format or ODBC TIMESTAMP format, just return tge ODBC DATE format portion of the value. This value may have come from a gateway query or is used by TO_DATE(val,"J") for Julian dates

• classmethod LogicalToXSD(%val As %Date) as %String
Converts the %Date value to the canonical SOAP encoded value.
• classmethod Normalize(%val As %RawString) as %Date
Converts %val to a normalized value.
• classmethod OdbcToLogical(%val As %String = "") as %Date
Converts %val, which represents a date in ODBC format, into $H format.

Returns the $H value of the ODBC date string %val.

• classmethod XSDToLogical(%val As %String) as %Date
Converts the SOAP encoded input date value into a %Date value.


Copyright (c) 2025 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.