isc_decode_sql_date()

From InterBase

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

ib_date

ISC_DATE *

Pointer to a four-byte ISC_DATE structure containing a date in InterBase format.

tm_date

void *

Pointer to a C tm structure

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 DATE data type is available only in dialect 3. It holds only date information, and does not include time information. In dialect 1, the TIMESTAMP data type holds both date and time information and is exactly equivalent to the DATE data 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.

See Also

Advance To: