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.

In the examples that follow, Htime is set to $PIECE($HOROLOG,",",2) for the currenttime. These examples show how to use the various forms of $ZTIME to return different timeformats.The following example in many cases returns time in the format "13:28:55"; however, thisformat is dependent on locale:SET Htime=$PIECE($HOROLOG,",",2)WRITE $ZTIME(Htime)The following example returns time in the format "13:28:55":SET Htime=$PIECE($HOROLOG,",",2)WRITE $ZTIME(Htime,1)The following example returns time in the format "13:28:55.999":SET Htime=$PIECE($HOROLOG,",",2)WRITE $ZTIME(Htime,1,3)The following example returns time in the format "13:28:55.999999999":SET Htime=$PIECE($HOROLOG,",",2)WRITE $ZTIME(Htime,1,9)The following example returns time in the format "13:28":SET Htime=$PIECE($HOROLOG,",",2)WRITE $ZTIME(Htime,2)The following example returns time in the format "01:28:24PM":SET Htime=$PIECE($HOROLOG,",",2)WRITE $ZTIME(Htime,3)The following example returns time in the format "01:28PM":SET Htime=$PIECE($HOROLOG,",",2)WRITE $ZTIME(Htime,4)The following example returns time in the format “13:45:56.021”, the current UTC time withthree decimal places of precision:SET t=$ZTIME($PIECE($ZTIMESTAMP,",",2),1,3)WRITE "Current UTC time is ",t$ZTIME<strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 379

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

Saved successfully!

Ooh no, something went wrong!