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

Go to the source code of this file.

Macros

#define _PCPSMKTM
 

Functions

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

Macro Definition Documentation

◆ _PCPSMKTM

#define _PCPSMKTM

Definition at line 28 of file pcpsmktm.c.

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().