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.

The following example uses $ZDATE to convert the date field in $HOROLOG to a dateformat.WRITE $ZDATE($PIECE($HOROLOG,",",1))returns a value formatted like this: 04/29/2002The following example converts the time portion of $HOROLOG to a time in the form ofhours:minutes:seconds on a 12-hour (a.m. or p.m.) clock.CLOCKTIMENEWSET Time=$PIECE($HOROLOG,",",2)SET Sec=Time#60SET Totmin=Time\60SET Min=Totmin#60SET Milhour=Totmin\60IF Milhour=12 { SET Hour=12,Meridian=" pm" }ELSEIF Milhour>12 { SET Hour=Milhour-12,Meridian=" pm" }ELSE { SET Hour=Milhour,Meridian=" am" }WRITE !,Hour,":",Min,":",Sec,MeridianQUITSee Also• $ZDATE function• $ZDATEH function• $ZDATETIME function• $ZDATETIMEH function• $ZTIME function• $ZTIMEH function• $ZUTIL(188) Local Date/Time with Fractional Seconds function• $ZUTIL(71) Set Date to a Fixed Value function• $ZTIMESTAMP special variable• $ZTIMEZONE special variable$HOROLOG<strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 435

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

Saved successfully!

Ooh no, something went wrong!