[BACK]Return to offtime.3 CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libc / time

File: [cvs.NetBSD.org] / src / lib / libc / time / offtime.3 (download)

Revision 1.3, Thu Apr 14 05:50:50 2011 UTC (13 years ago) by jruoho
Branch: MAIN
CVS Tags: yamt-pagecache-tag8, yamt-pagecache-base9, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, yamt-pagecache, tls-maxphys-base, tls-maxphys, tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb8-mediatek-base, matt-nb8-mediatek, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, localcount-20160914, cherry-xenmp-base, cherry-xenmp, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan, agc-symver-base, agc-symver
Changes since 1.2: +3 -2 lines

Xref tm(3).

.\"	$NetBSD: offtime.3,v 1.3 2011/04/14 05:50:50 jruoho Exp $
.\" Written by Klaus Klein, May 10, 2004.
.\" Public domain.
.Dd April 14, 2011
.Dt OFFTIME 3
.Os
.Sh NAME
.Nm offtime ,
.Nm timeoff ,
.Nm timegm ,
.Nm timelocal
.Nd convert date and time
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
.In time.h
.Ft struct tm *
.Fn offtime "const time_t * clock" "long int offset"
.Ft struct tm *
.Fn offtime_r "const time_t * clock" "long int offset" "struct tm *ret"
.Ft time_t
.Fn timeoff "struct tm * tm" "long int offset"
.Ft time_t
.Fn timegm "struct tm * tm"
.Ft time_t
.Fn timelocal "struct tm * tm"
.Sh DESCRIPTION
These functions are inspired by C standard interfaces named similarly.
.Pp
.Fn offtime
converts the calendar time
.Fa clock ,
offset by
.Fa offset
seconds,
into broken-down time, expressed as Coordinated Universal Time (UTC).
.Pp
.Fn offtime_r
is similar to
.Fn offtime
but it places the returned
.Ft "struct tm *"
in the user supplied
.Fa ret
argument.
.Pp
.Fn timeoff
converts the broken-down time
.Fa tm ,
expressed as UTC,
offset by
.Fa offset
seconds,
into a calendar time value.
.Pp
.Fn timegm
converts the broken-down time
.Fa tm
into a calendar time value, effectively being the inverse of
.Xr gmtime 3 .
It is equivalent to the C standard function
.Xr mktime 3
operating in UTC.
.Pp
.Fn timelocal
converts the broken down time
.Fa tm ,
expressed as local time, into a calendar time value.
It is equivalent to the C standard function
.Xr mktime 3 ,
and is provided for symmetry only.
.Sh SEE ALSO
.Xr ctime 3 ,
.Xr tm 3 ,
.Xr tzset 3