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 uint64_t shtime_t
The libshare representation of a particular time.
Note
Content is stored in network byte order.
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.
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.
shtime_t shtimeu
(time_t unix_t)
Generate a 64bit 'libshare time-stamp' given a unix epoch value.
int shtimems
(shtime_t t)
Obtain the milliseconds portion of the time specified.
char* shctime
(shtime_t t)
Display full ISO 8601 format of date and time.
time_t shutime
(shtime_t t)
Convert a share library timestamp into a unix timestamp.
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().
shtime_t shtime_adj
(shtime_t stamp, double secs)
Adjust a libshare time-stamp by a degree of seconds.
shtime_t shgettime
(struct timeval *tv)
convert a timeval into a libshare time-stamp
int shtime_after
(shtime_t stamp, shtime_t cmp_stamp)
test whether a time is more recent than another time.
int shtime_before
(shtime_t stamp, shtime_t cmp_stamp)
test whether a time is previous than another time.
shtime_t shmktime
(struct tm *tm)
convert a tm into a libshare time-stamp.
double shtime_diff
(shtime_t stamp, shtime_t cmp_stamp)
Calculate the difference between two timestamps in seconds.
SHTIME_EPOCH
(uint64_t)946684800