subsurface/core/subsurface-time.h
Berthold Stoeger b56dd13add build: remove extern "C" linkage
No more C source files, no more necessity to use C-linkage.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-08-13 19:28:30 +02:00

20 lines
603 B
C++

// SPDX-License-Identifier: GPL-2.0
#ifndef TIME_H
#define TIME_H
#include "units.h"
#include <string>
#include <time.h>
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 const char *monthname(int mon);
std::string format_datetime(timestamp_t timestamp); /* ownership of string passed to caller */
#endif