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.

$ZTIMEZONESetting the Time ZoneYou can use $ZTIMEZONE to set the time zone used by the current <strong>Caché</strong> process. Setting$ZTIMEZONE does not change the default <strong>Caché</strong> time zone or your computer's time zonesetting.Use the SET command to set $ZTIMEZONE to a specified signed integer number of minutes.Leading zeros and decimal portions of numbers are ignored. If you specify a non-numericvalue or no value when setting $ZTIMEZONE, <strong>Caché</strong> sets $ZTIMEZONE to 0 (GreenwichMean Time).For example, North American Eastern Standard Time (EST) is five hours west of GreenwichMean Time (GMT). Therefore, to set the current <strong>Caché</strong> process to EST you would specify300 minutes. To specify a time zone one hour east of GMT, you would specify –60 minutes.To specify GMT itself, you would specify 0 minutes.Setting $ZTIMEZONE:• affects the $HOROLOG local time value. It changes the time portion of $HOROLOG,and this change of time can also change the date portion of $HOROLOG for the currentprocess.• affects the value returned by $ZUTIL(193).• does not affect the $ZUTIL(188) local time value.• does not affect $ZTIMESTAMP or $ZHOROLOG values.• does not affect the date format conversions performed by the $ZDATE and $ZDATEHfunctions. The $ZUTIL(71) function, which sets the date in $HOROLOG to a fixedvalue, is also not affected by $ZTIMEZONE.Other Time Zone MethodsYou can obtain the same time zone information by invoking a system method, as follows:WRITE $SYSTEM.SYS.TimeZone()Refer to the “Class %SYSTEM.SYS” section of the <strong>Caché</strong> Class <strong>Reference</strong> for further details.You can return your local time variation as part of a date and time string by using the$ZDATETIME and $ZDATETIMEH functions with tformat values 5 or 6, as shown in thefollowing example:WRITE !,$ZDATETIME($HOROLOG,1,5)This returns a value such as:<strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 493

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

Saved successfully!

Ooh no, something went wrong!