mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
6b46e8ae57
To make it clear that the struct tm is only used as an input parameter. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
27 lines
655 B
C
27 lines
655 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
#ifndef TIME_H
|
|
#define TIME_H
|
|
|
|
#include "units.h"
|
|
#include <time.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
extern timestamp_t utc_mktime(const struct tm *tm);
|
|
extern void utc_mkdate(timestamp_t, struct tm *tm);
|
|
extern int utc_year(timestamp_t timestamp);
|
|
extern int utc_weekday(timestamp_t timestamp);
|
|
|
|
/* parse and format date times of the form YYYY-MM-DD hh:mm:ss */
|
|
extern timestamp_t parse_datetime(const char *s); /* returns 0 on error */
|
|
extern char *format_datetime(timestamp_t timestamp); /* ownership of string passed to caller */
|
|
|
|
extern const char *monthname(int mon);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|