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

Go to the source code of this file.

Macros

#define _ext   extern
 

Functions

time_t pcps_mktime (const PCPS_TIME *tp)
 Compute a linear time_t value from PCPS_TIME. More...
 

Macro Definition Documentation

◆ _ext

#define _ext   extern

Definition at line 35 of file pcpsmktm.h.

Function Documentation

◆ pcps_mktime()

time_t pcps_mktime ( const PCPS_TIME tp)

Compute a linear time_t value from PCPS_TIME.

This function works like the standard mktime() function but does not account for a timezone setting configured for the standard C library. Instead, since PCPS_TIME contains local time with specified UTC offset the UTC offset is removed to yield UTC time.

Parameters
[in]tpA timestamp in PCPS_TIME format
Returns
seconds since 1970-01-01 (Unix time_t format) or ((time_t) -1) if range overflow

Definition at line 49 of file pcpsmktm.c.

References PCPS_TIME::hour, mbg_mktime(), PCPS_TIME::mday, PCPS_TIME::min, PCPS_TIME::month, PCPS_TIME::offs_utc, PCPS_TIME::sec, and PCPS_TIME::year.

Referenced by set_system_time_from_pcps_time().