The datetime.h header file contains definitions for use with the DATETIME and INTERVAL data types. The header file datetime.h contains the declarations for the date, time, and interval data types, as follows:
In addition to these data structures, the datetime.h file defines the constants and macros for date and time qualifiers that Table 18 shows.
Table 18 shows the macro definitions that you can use to compose qualifier values. You need these macros only when you work directly with qualifiers in binary form. For example, if your program does not provide an mi_interval qualifier in the variable declaration, you need to use the mi_interval qualifier macros to initialize and set the mi_interval variable, as the following example shows:
/* Use the variable that was declared intvl1. */ mi_interval intvl1; ... /* Set the interval qualifier for the variable */ intvl1.in_qual = TU_IENCODE(2, TU_DAY, TU_SECOND); ... /* Assign a value to the variable */ incvasc ("5 2:10:02", &intvl1);
In the previous example, the mi_interval variable gets a day to second qualifier. The precision of the largest field in the qualifier, day, is set to 2.
In addition to the declaration of the dtime_t typedef and the preceding date and time macros, the datetime.h header file declares the DATETIME-type functions of the ESQL/C library. The mitypes.h header file automatically includes datetime.h. In turn, the milib.h header file automatically includes mitypes.h and mi.h automatically includes milib.h. Therefore, you automatically have access to the dtime_t and intrvl_t structures, the mi_datetime and mi_interval data types, any of the date or time macros, or any of the ESQL/C DATETIME-type functions when you include mi.h in your DataBlade API module.
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]