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.

Math and Time Functionsreturns Nov 4 1912.WRITE $ZDATE(26240,7)returns Nov 04 12.WRITE $ZDATE(26240,8)returns 19121104.WRITE $ZDATE(26240,9)returns November 4, 1912.WRITE $ZDATE(26240,10)returns 1.WRITE $ZDATE(26240,11)returns Mon.WRITE $ZDATE(26240,12)returns Monday.Two-digit Year Sliding Window ExampleTo illustrate how to use an explicit sliding window, suppose you enter the following functioncall in 1997. The hdate of 59461 represents October 19, 2003; the dformat of 1 allows it toreturn two-digit or four-digit years, and the yearopt of 5 specifies a sliding window for fourdigityears. Because of the yearopt setting, the startwin and endwin are calculated relative tothe current year (in this case 1997) by addition and subtraction.WRITE $ZDATE(59461,1,,5,90,10)The sliding window for displaying the year as two digits extends from 1/1/1907 to 12/31/2006.Thus <strong>Caché</strong> displays the date as 10/19/03.Date Range ExampleThe following example illustrates the use of mindate and maxdate. The dates are specifiedin $HOROLOG format, and represent the date range from 1/8/1950 to 4/10/2005.WRITE $ZDATE(59451,,,,,,40000,60000)displays as 10/09/2003.WRITE !,$ZDATE(39000,,,,,,40000,60000)WRITE !,$ZDATE(62000,,,,,,40000,60000)330 <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!