1DC_DATETIME_LOCALTIME(3) BSD Library Functions Manual DC_DATETIME_LOCALTIME(3)
2

NAME

4     dc_datetime_localtime — convert an timestamp to local date and time
5

LIBRARY

7     library “libdivecomputer”
8

SYNOPSIS

10     #include <libdivecomputer/datetime.h>
11
12     dc_datetime_t *
13     dc_datetime_localtime(dc_datetime_t *result, dc_ticks_t ticks);
14

DESCRIPTION

16     Convert an integral timestamp ticks created with dc_datetime_now(3) or
17     dc_datetime_mktime(3) into a broken-down local-time representation in
18     result.  The filled-in value consists of the year, month, day, hour,
19     minute, and second fields.
20
21     Note: unlike in struct tm, the value for year is normalised, not less
22     1900; moreover, the value for month is from one, not zero.
23
24     The dc_datetime_localtime function may internally invoke libc's
25     localtime(3), or if available, localtime_r(3).
26

RETURN VALUES

28     This returns the result pointer on success.  It returns NULL if ticks
29     cannot be sanely converted or if result is NULL.
30

SEE ALSO

32     dc_datetime_gmtime(3), dc_datetime_mktime(3), dc_datetime_new(3)
33

AUTHORS

35     The library “libdivecomputer” library was written by Jef Driesen,
36     jef@libdivecomputer.org.  The manpages were written by
37     Kristaps Dzonsons, kristaps@bsd.lv.
38
39BSD                            January 11, 2017                            BSD
Impressum