libarmutils  1.4
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Groups
time_utils.h File Reference

Time Utilities. More...

Go to the source code of this file.

Macros

#define TV_DOUBLE(tv)   ( (double)(tv).tv_sec + (1E-6 * (double)(tv).tv_usec) )
 Cast timeval to double.
#define TV_EQ(tv1, tv2)
 Check if timeval 1 is equal to timeval 2.
#define TV_NEQ(tv1, tv2)
 Check if timeval 1 is not equal to timeval 2.
#define TV_GT(tv1, tv2)
 Check if timeval 1 is greater than timeval 2.
#define TV_GTEQ(tv1, tv2)
 Check if timeval 1 is greater than or equal to timeval 2.
#define TV_LT(tv1, tv2)
 Check if timeval 1 is less than timeval 2.
#define TV_LTEQ(tv1, tv2)
 Check if timeval 1 is less than or equal to timeval 2.
#define IS_LEAP_YEAR(year)   ( ( (year % 4) == 0 && (year % 100) != 0 ) || (year % 400) == 0 )
 Check if a 4 digit year is a leap year.

Typedefs

typedef struct timeval timeval_t
 typedef for: struct timeval.

Functions

int days_in_month (int year, int month)
 Get the number of days in a month.
char * format_secs1970 (time_t secs1970, char *time_string)
 Create formatted time string.
char * format_time_values (int year, int mon, int day, int hour, int min, int sec, int usec, char *time_string)
 Create formatted time string.
char * format_timeval (const timeval_t *tval, char *time_string)
 Create formatted time string.
int four_digit_year (int year)
 Get the 4 digit year.
time_t get_secs1970 (int year, int mon, int day, int hour, int min, int sec)
 Convert time values to seconds since 1970.
time_t normalize_time_values (int *year, int *mon, int *day, int *hour, int *min, int *sec, int *usec)
 Normalize time values.
void normalize_timeval (timeval_t *tval)
 Normalize a timeval.
int time_values_check (int year, int mon, int day, int hour, int min, int sec, int usec)
 Check time values.
time_t timegm (const struct tm *tm_time)
 Convert a struct tm time to seconds since 1970.
void timeval_add (timeval_t *tv1, const timeval_t *tv2)
 Add two timevals.
void timeval_subtract (timeval_t *tv1, const timeval_t *tv2)
 Subtract two timevals.
void yday_to_mday (int yday, int *year, int *month, int *mday)
 Convert day of year to month and day of month.

Detailed Description

Time Utilities.

Definition in file time_utils.h.