1# 2#Copyright (c) 1994 Cygnus Support. 3#All rights reserved. 4# 5#Redistribution and use in source and binary forms are permitted 6#provided that the above copyright notice and this paragraph are 7#duplicated in all such forms and that any documentation, 8#and/or other materials related to such 9#distribution and use acknowledge that the software was developed 10#at Cygnus Support, Inc. Cygnus Support, Inc. may not be used to 11#endorse or promote products derived from this software without 12#specific prior written permission. 13#THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 14#IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 15#WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 16# 17@node Timefns 18@chapter Time Functions (@file{time.h}) 19 20This chapter groups functions used either for reporting on time 21(elapsed, current, or compute time) or to perform calculations based 22on time. 23 24The header file @file{time.h} defines three types. @code{clock_t} and 25@code{time_t} are both used for representations of time particularly 26suitable for arithmetic. (In this implementation, quantities of type 27@code{clock_t} have the highest resolution possible on your machine, 28and quantities of type @code{time_t} resolve to seconds.) @code{size_t} 29is also defined if necessary for quantities representing sizes. 30 31@file{time.h} also defines the structure @code{tm} for the traditional 32representation of Gregorian calendar time as a series of numbers, with 33the following fields: 34 35@table @code 36@item tm_sec 37Seconds, between 0 and 60 inclusive (60 allows for leap seconds). 38 39@item tm_min 40Minutes, between 0 and 59 inclusive. 41 42@item tm_hour 43Hours, between 0 and 23 inclusive. 44 45@item tm_mday 46Day of the month, between 1 and 31 inclusive. 47 48@item tm_mon 49Month, between 0 (January) and 11 (December). 50 51@item tm_year 52Year (since 1900), can be negative for earlier years. 53 54@item tm_wday 55Day of week, between 0 (Sunday) and 6 (Saturday). 56 57@item tm_yday 58Number of days elapsed since last January 1, between 0 and 365 inclusive. 59 60@item tm_isdst 61Daylight Savings Time flag: positive means DST in effect, zero means DST 62not in effect, negative means no information about DST is available. 63Although for mktime(), negative means that it should decide if DST is in 64effect or not. 65@end table 66 67@menu 68* asctime:: Format time as string 69* clock:: Cumulative processor time 70* ctime:: Convert time to local and format as string 71* difftime:: Subtract two times 72* gmtime:: Convert time to UTC (GMT) traditional representation 73* localtime:: Convert time to local representation 74* mktime:: Convert time to arithmetic representation 75* strftime:: Convert date and time to a user-formatted string 76* time:: Get current calendar time (as single number) 77* __tz_lock:: Lock time zone global variables 78* tzset:: Set timezone info 79@end menu 80 81@page 82@include time/asctime.def 83 84@page 85@include time/clock.def 86 87@page 88@include time/ctime.def 89 90@page 91@include time/difftime.def 92 93@page 94@include time/gmtime.def 95 96@page 97@include time/lcltime.def 98 99@page 100@include time/mktime.def 101 102@page 103@include time/strftime.def 104 105@page 106@include time/time.def 107 108@page 109@include time/tzlock.def 110 111@page 112@include time/tzset.def 113