nrelease - fix/improve livecd
[dragonfly.git] / lib / libc / stdtime / offtime.3
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
23 These functions are inspired by C standard interfaces named similarly.
24 .Pp
25 .Fn offtime
26 converts the calendar time
27 .Fa clock ,
28 offset by
29 .Fa offset
30 seconds,
31 into broken-down time, expressed as Coordinated Universal Time (UTC).
32 .Pp
33 .Fn timeoff
34 converts the broken-down time
35 .Fa tm ,
36 expressed as UTC,
37 offset by
38 .Fa offset
39 seconds,
40 into a calendar time value.
41 .Pp
42 .Fn timelocal
43 converts the broken down time
44 .Fa tm ,
45 expressed as local time, into a calendar time value.
46 It is equivalent to the C standard function
47 .Xr mktime 3 ,
48 and is provided for symmetry only.
49 .Sh SEE ALSO
50 .Xr ctime 3 ,
51 .\".Xr tm 3 ,
52 .Xr tzset 3