basic: add mktime_or_timegm and localtime_or_gmtime_r

to time-util.h. They take an extra argument `bool utc`.
This commit is contained in:
Hristo Venev
2015-10-15 02:34:45 +03:00
parent 19833db683
commit 7c67c79c9a
2 changed files with 15 additions and 10 deletions
+5 -1
View File
@@ -21,8 +21,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <stdio.h>
#include <inttypes.h>
#include <stdio.h>
#include <time.h>
typedef uint64_t usec_t;
typedef uint64_t nsec_t;
@@ -117,3 +118,6 @@ clockid_t clock_boottime_or_monotonic(void);
"xstrftime: " #buf "[] must be big enough")
int get_timezone(char **timezone);
time_t mktime_or_timegm(struct tm *tm, bool utc);
struct tm *localtime_or_gmtime_r(const time_t *t, struct tm *tm, bool utc);