isc_decode_sql_time()

From InterBase
Jump to: navigation, search

Go Up to API Function Reference


Translates a time from InterBase ISC_TIME format into the C struct tm format.

Syntax

void isc_decode_sql_time(
ISC_TIME *ib_time,
void *tm_date);

Parameter Type Description

ib_time

ISC_TIME *

Pointer to a four-byte ISC_TIME structure containing a time in InterBase format.

tm_date

void *

Pointer to a C struct tm structure

Description

isc_decode_sql_time() translates a time retrieved from a table and stored in an ­ISC_TIME variable, ib_time, into a C time structure for program manipulation. Both ib_time and tm_date must be declared and initialized before use.

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

Note: isc_decode_sql_time() 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_time() to translate an InterBase date format into a C time format:

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

Return value

None.

See Also

Advance To: