Datetime types

Open Client supports four datetime types: CS_DATE, CS_TIME, CS_DATETIME, and CS_DATETIME4. These datatypes are intended to hold 8-byte and 4-byte datetime values:

An application can call the CS-Library routine cs_convert to initialize a datetime type from a character string. cs_convert recognizes all of the date and time formats valid for Transact-SQL datetime character strings. See the “Datatypes” topic in the Adaptive Server Enterprise Reference Manual for more information about these formats.

cs_convert can also convert a CS_DATETIME or CS_DATETIME4 value into a character string.

Other routines that are useful when working with datetime values include:

cs_convert, cs_cmp, cs_dt_crack, and cs_dt_info use locale information that is specified indirectly, using the CS_CONTEXT, or directly, using a CS_LOCALE structure. (See “CS_LOCALE”.) An application can change the locale information for a CS_CONTEXT by calling cs_config to set the CS_LOC_PROP property for the context.