cryptnox-pos 1.0.0
Standalone USDC payment terminal firmware (ESP32 + Cryptnox smart card)
Loading...
Searching...
No Matches
civil_time.h
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: LGPL-3.0-or-later
3 * Copyright (c) 2026 Cryptnox SA
4 */
5
18
19#ifndef CIVIL_TIME_H
20#define CIVIL_TIME_H
21
22/******************************************************************
23 * 1. Included files
24 ******************************************************************/
25
26#include <stdint.h>
27#include <stdbool.h>
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33/******************************************************************
34 * 2. Public API
35 ******************************************************************/
36
52int64_t civil_to_epoch(int year, int mon, int day, int hour, int min, int sec);
53
61int civil_month_from_abbrev(const char *mmm);
62
74bool civil_parse_build_stamp(const char *date, const char *time_str,
75 int64_t *out);
76
89bool civil_parse_http_date(const char *hdr, int64_t *out);
90
107
116int civil_local_offset_min(int64_t utc, int std_off_min, int rule);
117
118#ifdef __cplusplus
119}
120#endif
121
122#endif // CIVIL_TIME_H
bool civil_parse_http_date(const char *hdr, int64_t *out)
Parse an HTTP-date in IMF-fixdate form into an epoch value.
int civil_month_from_abbrev(const char *mmm)
Map a three-letter English month abbreviation to 1–12.
bool civil_parse_build_stamp(const char *date, const char *time_str, int64_t *out)
Parse the compiler's DATE / TIME pair into an epoch value.
int64_t civil_to_epoch(int year, int mon, int day, int hour, int min, int sec)
Convert a UTC civil date/time to seconds since the Unix epoch.
civil_dst_t
Daylight-saving rules the panel clock knows, persisted in NVS as a number, so never renumber them.
Definition civil_time.h:99
@ CIVIL_DST_NZ
Definition civil_time.h:104
@ CIVIL_DST_US
Definition civil_time.h:102
@ CIVIL_DST_EU
Definition civil_time.h:101
@ CIVIL_DST__COUNT
Definition civil_time.h:105
@ CIVIL_DST_NONE
Definition civil_time.h:100
@ CIVIL_DST_AU
Definition civil_time.h:103
int civil_local_offset_min(int64_t utc, int std_off_min, int rule)
Offset from UTC in force at utc, DST included.