mbgtools-lx  4.2.8
mbgmktm.h File Reference
#include <time.h>

Go to the source code of this file.

Macros

#define _ext   extern
 

Functions

time_t mbg_mktime (int year, int month, int day, int hour, int min, int sec)
 Compute a linear time_t value from broken down date and time. More...
 

Macro Definition Documentation

◆ _ext

#define _ext   extern

Definition at line 33 of file mbgmktm.h.

Function Documentation

◆ mbg_mktime()

time_t mbg_mktime ( int  year,
int  month,
int  day,
int  hour,
int  min,
int  sec 
)

Compute a linear time_t value from broken down date and time.

This function works like the standard mktime() function but does not account for a timezone setting configured for the standard C library. Also, it does not take a structure but a set of variables which makes it more versatile. The accepted variables are in the same ranges as the struct tm members used by mktime().

Parameters
[in]yearyear number - 1900
[in]monthmonths since January, 0..11
[in]daydays after 1st, 0..30
[in]hour0..23
[in]min0..59
[in]sec0..59, 60 if leap second
Returns
seconds since 1970-01-01 (Unix time_t format) or ((time_t) -1) if range overflow

Definition at line 61 of file mbgmktm.c.

References Days, and YDays.

Referenced by pcps_mktime(), and tm_gps_to_nano_time_64().