The DATETIME and INTERVAL data types are internally represented with the dtime_t and intrvl_t structures, respectively. Information about these structures can be found in the header file datetime.h, which is included in the ESQL/C product. Include this file in all C source files that use any of the DATETIME and INTERVAL functions.
You must use the following ESQL/C library functions for the datetime and interval data types to perform all operations on those types of values.
| Function Name | Description |
|---|---|
| dtaddinv( ) | Adds an interval value to a datetime value |
| dtcurrent( ) | Gets the current date and time |
| dtcvasc( ) | Converts an ANSI-compliant character string to a datetime value |
| dtcvfmtasc( ) | Converts a character string with a specified format to a datetime value |
| dtextend( ) | Changes the qualifier of a datetime value |
| dtsub( ) | Subtracts one datetime value from another |
| dsubinv() | Subtracts an interval value from a datetime value |
| dttoasc( ) | Converts a datetime value to an ANSI-compliant character string |
| dttofmtasc( ) | Converts a datetime value to a character string with a specified format |
| incvasc( ) | Converts an ANSI-compliant character string to an interval value |
| incvfmtasc( ) | Converts a character string with a specified format to an interval value |
| intoasc( ) | Converts an interval value to an ANSI-compliant character string |
| intofmtasc( ) | Converts an interval value to a character string with a specified format |
| invdivdbl( ) | Divides an interval value by a numeric value |
| invdivinv( ) | Divides an interval value by another interval value |
| invextend( ) | Extends an interval value to a different interval qualifier |
| invmuldbl( ) | Multiples an interval value by a numeric value |
For more information about the individual functions, see the following: IBM Informix ESQL/C Programmer's Manual.