11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Math and Time FunctionsWhen supplied, the erropt parameter suppresses errors generated due to invalid or out ofrange values of hdate. Errors generated due to invalid or out of range values of other parameterswill always generate errors whether or not erropt has been supplied.For example, an error is always generated when $ZDATE specifiesa sliding window where endwin is earlier than startwin. Similarly, an error is generated when maxdate is less than mindate.Error Handling with $ZUTIL(68,32) and $ZUTIL(69,32)The behavior of $ZDATE when given an invalid value for hdate can be set by using the$ZUTIL(68,32) and $ZUTIL(69,32) functions. $ZDATE can either issue an error, or returna null value. See $ZUTIL(68,32) Set Date Range and Invalid Date Behavior.The system-wide default behavior is configurable. Go to the System Management Portal,select System Configuration, select Advanced Settings, on the pull-down Category list select<strong>ObjectScript</strong>. View and edit the current setting of NullZDATE. The default is “false” , meaningthat $ZDATE returns an error.Using $ZDATE Instead of UtilitiesKeep the following points in mind when you need to choose between the $ZDATE functionand a date utility:• You can use the $ZDATE function in place of most existing entry points of the %DOor %D utilities.• You can invoke $ZDATE($HOROLOG,7) directly instead of calling INT ^%D. Thisprovides the current date in “Mmm DD [YY]YY” format.• $ZDATEH and $ZDATE are much faster than calling entry points of %DATE, %DIor %DO.Date Delimiter$ZDATE will use the value of the DateSeparator property of the current locale as thedelimiter between months, days, and the year when dformat=1 or 4. The delimiter in theODBC date format (dformat=3) will always be a “-” as required by the ODBC standard. Thedefault value of DateSeparator is “/” and all documentation uses this delimiter.See Also• JOB command• $ZDATEH function332 <strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!