isc_decode_sql_date()
Go Up to API Function Reference
Translates a date from InterBase ISC_DATE format into the C struct tm format.
Syntax
void isc_decode_sql_date(
ISC_DATE *ib_date,
void *tm_date);
| Parameter | Type | Description |
|---|---|---|
|
|
|
Pointer to a four-byte |
|
|
|
Pointer to a C |
Description
isc_decode_sql_date() translates a date retrieved from a table and stored in an ISC_DATE variable, ib_date, into a C time structure for program manipulation. Both ib_date and tm_date must be declared and initialized before use.
Use the isc_dsql family of API calls to retrieve InterBase DATE data from a table into the ISC_DATE structure prior to translation.
- Note: In InterBase 6 and later, the
DATEdata type is available only in dialect 3. It holds only date information, and does not include time information. In dialect 1, theTIMESTAMPdata type holds both date and time information and is exactly equivalent to theDATEdata type that was present in earlier versions of InterBase.
Example
The following code fragment illustrates declaring time structures and calling isc_decode_sql_date() to translate an InterBase date format into a C time format:
#include <time.h> #include <ibase.h> . . . struct tm hire_time; ISC_DATE hire_date; . . . /* Retrieve DATE data from a table here. */ . . . isc_decode_sql_date(&hire_date, &hire_time);
Return value
None.