Validation: InterSystems IRIS performs canonical numeric conversion on hdatetime. The date and time portions of hdatetime are parsed separately. It parses the first comma encountered as the date/time separator. Additional commas are treated as non-numeric characters.
Parsing of each portion of an hdatetime string halts at the first non-numeric character. Therefore, an hdatetime such as 64687AD,1234SECS is the same as 64687,1234. A non-numeric date or time portion (including the null string) evaluates to 0. Thus an empty string hdatetime returns the $HOROLOG initial date: December 31, 1840.
However, if the date portion value does not evaluate to an integer (contains a non-zero fractional number) it generates an <ILLEGAL VALUE> error.
Range: The date portion of hdatetime must evaluate to an integer within the mindate/maxdate range. By default, date values greater than 2980013 or less than 0 generate a <VALUE OUT OF RANGE> error. By setting mindate to a negative number, you can extend the range of valid dates before December 31, 1840. However, for dformat 18, 19, 20, or 21 (Hijri Islamic calendar) dates, any date prior to -445031 generates an <ILLEGAL VALUE> error, even if mindate is set to an earlier date.
A time portion of hdatetime with a value greater than 86399 generates an <ILLEGAL VALUE> error. A negative hdatetime time value generates an <ILLEGAL VALUE> error.