group
group__libshare__time
Time operations are performed in order to store and compare timestamps in the sharefs file system and for network operations.

System Time Routines

typedef
typedef uint64_t shtime_t
The libshare representation of a particular time.
Note
Content is stored in network byte order.
function
double shtimef
(shtime_t stamp)
Generate A float-point precision representation of the specified time.
Return Value
An double representing the seconds since Year 2000 UTC.
function
shtime_t shtime
(void)
Generate a 64bit representation integral of the current time with millisecond precision.
Return Value
An unsigned long representing the milliseconds since 200 UTC.
Note
32bit friendly.
function
shtime_t shtimeu
(time_t unix_t)
Generate a 64bit 'libshare time-stamp' given a unix epoch value.
function
int shtimems
(shtime_t t)
Obtain the milliseconds portion of the time specified.
function
char* shctime
(shtime_t t)
Display full ISO 8601 format of date and time.
function
time_t shutime
(shtime_t t)
Convert a share library timestamp into a unix timestamp.
function
char* shstrtime
(shtime_t t, char *fmt)
Convert a libshare time-stamp into a string format.
Param
fmt
If NULL then "%x %X" will be used.
Note
This function utilizes the same time tokens as strftime().
function
shtime_t shtime_adj
(shtime_t stamp, double secs)
Adjust a libshare time-stamp by a degree of seconds.
function
shtime_t shgettime
(struct timeval *tv)
convert a timeval into a libshare time-stamp
function
int shtime_after
(shtime_t stamp, shtime_t cmp_stamp)
test whether a time is more recent than another time.
function
int shtime_before
(shtime_t stamp, shtime_t cmp_stamp)
test whether a time is previous than another time.
function
shtime_t shmktime
(struct tm *tm)
convert a tm into a libshare time-stamp.
function
double shtime_diff
(shtime_t stamp, shtime_t cmp_stamp)
Calculate the difference between two timestamps in seconds.
define
ONE_HOUR
3600
define
SHTIME_UNDEFINED
0
define
SHTIME_EPOCH
(uint64_t)946684800