xref: /dragonfly/lib/libc/stdtime/offtime.3 (revision 6e316fcd)
1.\"	$NetBSD: offtime.3,v 1.4 2017/10/25 19:01:25 abhinav Exp $
2.\" Written by Klaus Klein, May 10, 2004.
3.\" Public domain.
4.Dd May 4, 2019
5.Dt OFFTIME 3
6.Os
7.Sh NAME
8.Nm offtime ,
9.Nm timeoff ,
10.Nm timelocal
11.Nd convert date and time
12.Sh LIBRARY
13.Lb libc
14.Sh SYNOPSIS
15.In time.h
16.Ft struct tm *
17.Fn offtime "const time_t * clock" "long int offset"
18.Ft time_t
19.Fn timeoff "struct tm * tm" "long int offset"
20.Ft time_t
21.Fn timelocal "struct tm * tm"
22.Sh DESCRIPTION
23These functions are inspired by C standard interfaces named similarly.
24.Pp
25.Fn offtime
26converts the calendar time
27.Fa clock ,
28offset by
29.Fa offset
30seconds,
31into broken-down time, expressed as Coordinated Universal Time (UTC).
32.Pp
33.Fn timeoff
34converts the broken-down time
35.Fa tm ,
36expressed as UTC,
37offset by
38.Fa offset
39seconds,
40into a calendar time value.
41.Pp
42.Fn timelocal
43converts the broken down time
44.Fa tm ,
45expressed as local time, into a calendar time value.
46It is equivalent to the C standard function
47.Xr mktime 3 ,
48and is provided for symmetry only.
49.Sh SEE ALSO
50.Xr ctime 3 ,
51.\".Xr tm 3 ,
52.Xr tzset 3
53