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.

is a date, the second integer is a time.) Two or four digits may be specified for years in therange 1900 to 1999. Four digits must be specified for years before 1900 or after 1999.Customizable $ZDATEH Format$ZDATEH(date,dformat,monthlist,yearopt,startwin,endwin,mindate,maxdate,erropt) convertsa date in the specified dformat to $HOROLOG format. The dformat, monthlist, yearopt,startwin, endwin, mindate, maxdate and erropt values are identical to the values used by$ZDATE. However, when you use a dformat of 5, 6, 7, 8, or 9, $ZDATEH recognizes andconverts a date in any of the external date formats defined for dformat codes 1, 2, 3, 5, 6, 7,8, and 9. (But not dformat code 4.) It also recognizes a special relative date format that consistsof a string beginning with the letter T or t (indicating “today”,) optionally followed by a plus(+) or a minus (-) sign, and an integer number of days after or before the current date.Parametersdate$ZDATEHThe date you want converted to $HOROLOG format, specified as a quoted string. This canbe an explicit date, or the implicit current date, represented by the string “T” or “t”.An explicit date must be specified in one of the formats supported by dformat. The permittedformat(s) depends on the dformat parameter. If dformat is not specified or is 1, 2, 3, or 4,only one date format is permitted. If dformat is 5, 6 , 7, 8, or 9, multiple date formats arepermitted. Note that European Date Format (dformat=4) is not one of the multiple date formatspermitted, because $ZDATEH could not differentiate between 02/03/02 (meaning February3, 2002) and the European 02/03/02 (meaning March 2, 2002). If you want European dateformat, you must explicitly specify dformat=4. If you specify a date in a non-permitted format,or a nonexistent date (such as February 31, 2002), $ZDATEH generates an error code. ($ZDATEH does check for leap year dates, permitting Feb. 29, 2004but not Feb. 29, 2003.)An implicit date is specified as a string beginning with the letter “T” or “t”, indicating thecurrent (today's) date. This string can optionally include a plus or minus sign and an integer,which specify a number of days offset from the current date. For example, “t+9” (nine daysafter the current date) or “t-12” (twelve days before the current date). Implicit dates are onlypermitted if dformat is 5, 6, 7, 8, or 9. The only permitted implicit date forms are “T” (or “t”),and “T” (or “t”) followed by a sign and integer. <strong>Caché</strong> generates an error if you specify a non-integer number, an arithmetic expression, an integer without a sign,or a sign without an integer. “T+0” and “T-0” are permitted, and return the current date.<strong>Caché</strong> generates a error if you specify an offset that wouldresult in a $HOROLOG date smaller than 0 or representing a date after the year 9999.<strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 335

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

Saved successfully!

Ooh no, something went wrong!