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.

<strong>Caché</strong> <strong>ObjectScript</strong> Special VariablesSee Also• $ZDATETIME function• $ZUTIL(188) Local Date/Time with Fractional Seconds function• $ZUTIL(193) Convert UTC to Local Date/Time function• $HOROLOG special variable• $ZTIMEZONE special variable$ZTIMEZONEContains the time zone offset from GMT.$ZTIMEZONE$ZTZDescription$ZTIMEZONE contains the time zone offset from GMT (Greenwich Mean Time) in minutes.This offset is expressed as a signed integer in the range -720 to 720. Time zones west of GMTare specified as positive numbers; time zones east of GMT are specified as negative numbers.(Time zones must be expressed in minutes, because not all time zone differences are in wholehours.) By default, $ZTIMEZONE is initialized to the time zone set for the computer'soperating system.Note:$ZTIMEZONE does not adjust for Daylight Savings Time or other local timevariants.You can use $ZTIMEZONE to convert a Coordinated Universal Time (UTC) date and timevalue to a local time value by using $ZUTIL(193). This function takes as input a UTC value,such as a $ZTIMESTAMP value, and a time zone offset value in minutes, such as a$ZTIMEZONE value. $ZUTIL(193) returns the corresponding date and time for the specifiedlocal time zone, with local time variants (such as Daylight Savings Time) applied whereapplicable.SET clock=$HOROLOGSET stamp=$ZUTIL(193,$ZTIMESTAMP,$ZTIMEZONE)WRITE !,"local/local date and time: ",$ZDATETIME(clock,1,1,2)WRITE !,"UTC/local date and time: ",$ZDATETIME(stamp,1,1,2)492 <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!