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.

Math and Time FunctionsNote:Two-digit years, by default, are considered 20th Century dates; for 21st Centurydates, specify a four-digit year, or change the two-digit sliding window by specifyingthe yearopt, startwin and endwin parameters. This sliding window can also be setfor your locale.The following example shows how the dformat parameter is used to permit multiple dateentry formats:WRITE !,$ZDATEH("November 2, 1954",5)WRITE !,$ZDATEH("Nov 2, 1954",5)WRITE !,$ZDATEH("Nov. 2 1954",5)WRITE !,$ZDATEH("11/2/1954",5)WRITE !,$ZDATEH("11.02.54",5)WRITE !,$ZDATEH("11 02 1954",5)all return 41578.In the following examples, suppose the current date is November 25, 2002:WRITE $HOROLOGreturns 59133,37854, the first integer of which is the current date.The next example uses the “T” date to return today's date (here, Nov. 25, 2002):WRITE $ZDATEH("T",5)returns 59133.WRITE $ZDATEH("T+7",5)returns 59140.The final example illustrates that when no year is specified, $ZDATEH assumes the currentyear (in this case, 2002):WRITE $ZDATEH("25 Nov",5)returns 59133.NotesLeading ZerosAny numeric date value (or integer date offset) may include any number of leading zeros, oromit all leading zeros.Invalid Values with $ZDATEHYou receive a error in the following conditions:340 <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!