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.

ODBC date format (dformat=3) will always be a “-” as required by the ODBC standard. Thedefault value of DateSeparator is “/” and all documentation uses this delimiter.Decimal Delimiter$ZDATETIME will use the value of the DecimalSeparator property of the current locale asthe delimiter between the whole and fractional parts of numbers. The delimiter in the ODBCdate format (dformat=3) will always be a “.” as required by the ODBC standard. The defaultvalue of DecimalSeparator is “.” and all documentation uses this delimiter.Time DelimiterBy default, <strong>Caché</strong> uses the value of the TimeSeparator property of the current locale todetermine the delimiter character for the time string. By default, the delimiter is “:” and thisdelimiter has been used in all of our examples.Time SuffixesBy default, <strong>Caché</strong> uses properties in the current locale to determine the names of its timesuffixes. For $ZDATETIME, these properties (and their corresponding default values) are:• AM (“AM”)• PM (“PM”)This documentation will always use these default values for these properties.Customizable Date and Time Defaults$ZDATETIMEThe default date format is set in the DateFormat property of your locale. This is the dateformat returned when dformat is omitted or set to –1. The default date separator and decimalseparator characters are also defined for your locale. You can change these defaults for yourlocale by using NLS (National Language Support) functions.In the following example, the first $ZDATETIME returns a date and time in the defaultformat for the locale. The input parameters are the $ZTIMESTAMP special variable, withthe dformat and tformat taking defaults, and precision set to 2 decimal digits. In most locales,the first $ZDATETIME will return dformat=1 or the American date and time format witha slash date separator and a dot decimal separator for fractional seconds.The first NLS function changes the locale date format default to dformat=4, or the Europeandate format (DD/MM/[YY]YY), as is shown by the second $ZDATETIME. The secondNLS function changes the locale default for the date separator character (which affects thedformat –1, 1, and 4). In this example, the date separator character is set to a dot (“.”), as<strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 353

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

Saved successfully!

Ooh no, something went wrong!