11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

$ZDATETIMEmindateA numeric value that specifies the lower limit of the range of valid dates. If omitted or specifiedas -1, this limit is obtained from the DateMinimum property of the current locale, whichdefaults to zero (corresponding to December 31, 1840).maxdateA numeric value that specifies the upper limit of the range of valid dates. If omitted or ifspecified as -1, this limit is obtained from the DateMaximum property of the current locale,which defaults to the maximum permissible value for the date portion of $HOROLOG:2980013 (corresponding to December 31, 9999). Attempting to exceed maxdate generates a error message.erroptThis parameter suppresses error messages associated with invalid or out of range hdatetimevalues. Instead of generating or errormessages, the function returns erropt.ExamplesThe following example displays the current local date and time. It takes the default date andtime format for the locale:WRITE $ZDATETIME($HOROLOG)The following example displays the current date and time. $ZTIMESTAMP contains thecurrent date and time value as Coordinated Universal Time (UTC) date and time. The dformatparameter specifies ODBC date format, the tformat parameter specifies a 24-hour clock, andthe precision parameter specifies 6 digits of fractional second precision:WRITE $ZDATETIME($ZTIMESTAMP,3,1,6)returns the current timestamp date and time, formatted like: 2005-11-25 18:45:16.960000.The following example shows how a local time can be converted to UTC time, and how thedate may also change as a result of this conversion. In most time zones, the time conversionin one of the following $ZDATETIME operations also changes the date:SET local = $ZDATETIME("60219,82824",3,1)SET utcwest = $ZDATETIME("60219,82824",3,7)SET utceast = $ZDATETIME("60219,00024",3,7)WRITE !,local,!,utcwest,!,utceast<strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 351

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

Saved successfully!

Ooh no, something went wrong!