isc_decode_timestamp()

From InterBase

Go Up to API Function Reference


Translates a date and time from InterBase ISC_TIMESTAMP format into the C struct tm format.

Syntax

 void isc_decode_timestamp(
 ISC_TIMESTAMP *ib_date,
 void *tm_date);
Parameter Type Description

ib_timestamp

ISC_TIMESTAMP *

Pointer to an eight-byte ISC_TIMESTAMP structure containing a date and time in InterBase format.

tm_date

void *

Pointer to a C struct tm structure

Description

isc_decode_timestamp() translates a date retrieved from a table and stored in an ­ISC_TIMESTAMP variable, ib_timestamp, into a C time structure for program manipulation. Both ib_timestamp and tm_date must be declared and initialized before use. The isc_decode_timestamp() is exactly the same as the isc_decode_date() function in versions of InterBase prior to 6.0.

Use the isc_dsql family of API calls to retrieve InterBase TIMESTAMP data from a table into the ISC_TIMESTAMP structure prior to translation.

Note: isc_decode_timestamp() does not support milliseconds, because encode/decode functions use the structure struct tm from time.h, which does not support a fractional part for seconds.

Example

The following code fragment illustrates declaring time structures and calling isc_decode_sql_timestamp() to translate an InterBase date format into a C time format:

#include <time.h>
#include <ibase.h>
. . .
struct tm hire_time;
ISC_TIMESTAMP hire_date;
. . .
/* Retrieve TIMESTAMP data from a table here. */
. . .
isc_decode_timestamp(&hire_date, &hire_time);

Return value

None.

See Also

Advance To: