cp_timestampz(3)

cp_dbms(3) cp_dbms cp_dbms(3)

NAME

cp_timestampz, cp_timestampz_create, cp_timestampz_create_prm, cp_timestampz_destroy, cp_timestampz_localtime - an object to represent time and time zone

SYNOPSIS

#include <time.h> #include <sys/time.h> #include <cprops/db.h>

cp_timestampz *cp_timestampz_create(struct timeval *tm, int minuteswest);
cp_timestampz * cp_timestampz_create_prm(int sec_since_epoch, int microsec, int minwest);
void cp_timestampz_destroy(cp_timestampz *tmz);
struct tm *cp_timestampz_localtime(cp_timestampz *tmz, struct tm *res);

DESCRIPTION

cp_timestampz represents time as with a struct timeval and an integer describing the time zone as the number of minutes west of UTC.
cp_timestampz_create and cp_timestampz_create_prm create a new time stamp structure.
cp_timestampz_destroy deallocates a time stamp object.
cp_timestampz_localtime returns broken-down time in a struct tm.

RETURN VALUE

cp_timestampz_create and cp_timestampz_create_prm return a newly allocated cp_timestampz structure on success or NULL if memory for the new structure could not be allocated. cp_timestampz_localtime returns a struct tm * representing the localtime for the given timestamp and time zone.

SEE ALSO

localtime(3)

MARCH 2006 libcprops