#include <mplib1/timestamp.h>
char * make_timestamp_str( char *buffer );The make_timestamp_str function generates a timestamp string from the current time from the build_timestamp_str function. formatted to ISO 8601 / EN28601 based on the current time.
The timestamp is in UTC and is formed using strftime() and then adding hundredths of seconds and timezone offset.
The buffer parameter specifies a data area in which to create this string. If it is provided it should be at least 24 characters long. If the buffer parameter is NULL then the routine uses an internal static buffer, the resultant value should be used immediately or copied. An example of the completed string is;
"1996-12-31 13:45:56.78Z"This function is implemented using the following two functions.
char *build_timestamp_str( struct timeval *tvp, char *buf );This function function generates a timestamp string formatted to ISO 8601 / EN28601 based on the supplied timeval structure.
The timestamp is in UTC and is formed using strftime() and then adding hundredths of seconds and timezone offset.
The buffer parameter specifies a data area in which to create this string. If it is provided it should be at least 24 characters long. If the buffer parameter is NULL then the routine uses an internal static buffer, the resultant value should be used immediately or copied. An example of the completed string is;
"1996-12-31 13:45:56.78Z"
struct timeval *get_current_timeval( struct timeval * );This function gets the current time of day in UTC using the system gettimeofday function. It is provided as a platform independant variation of the system call because it varies between implementations.