Sun Microsystems, Inc.
spacerspacer
spacer   www.sun.com docs.sun.com | | |  
spacer
black dot
   
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z
    
 
Headerstime(3HEAD)


NAME

 time - time types

SYNOPSIS

 
#include <time.h> 

DESCRIPTION

 

The <time.h> header declares the structure tm, which includes the following members:

 
int        tm_sec          seconds [0,61]
int        tm_min          minutes [0,59]
int        tm_hour         hour [0,23]
int        tm_mday         day of month [1,31]
int        tm_mon          month of year [0,11]
int        tm_year         years since 1900
int        tm_wday         day of week [0,6] (Sunday = 0)
int        tm_yday         day of year [0,365]
int        tm_isdst        daylight savings flag

The value of tm_isdst is positive if Daylight Saving Time is in effect, 0 if Daylight Saving Time is not in effect, and negative if the information is not available.

This header defines the following symbolic names:

NULL
Null pointer constant.
CLK_TCK
Number of clock ticks per second returned by the times(2) function.
CLOCKS_PER_SEC
A number used to convert the value returned by the clock(3C) function into seconds.

The <time.h> header declares the structure timespec, which has the following members:

 
time_t  tv_sec    seconds
long    tv_nsec   nanoseconds

This header also declares the itimerspec structure, which has at least the following members:

 
struct timespec   it_interval  timer period
struct timespec   it_value     timer expiration

The following manifest constants are defined:

CLOCK_REALTIME
The identifier of the systemwide realtime clock.
TIMER_ABSTIME
Flag indicating time is absolute with respect to the clock associated with a timer.

The clock_t, size_t and time_t types are defined as described in <sys/types.h>.

Although the value of CLOCKS_PER_SEC is 1 million on all Solaris systems, it may be variable on other systems and it should not be assumed that CLOCKS_PER_SEC is a compile-time constant.

The value of CLK_TCK is currently the same as the value of sysconf(_SC_CLK_TCK); however, new applications should call sysconf(3C) because the CLK_TCK macro may be withdrawn in a future issue.

The <time.h> header provides a declaration for getdate_err.

The following are declared as variables:

 
extern int       daylight;
extern long int  timezone;
extern char      *tzname[];

USAGE

 

The range [0,61] for tm_sec allows for the occasional leap second or double leap second.

tm_year is a signed value, therefore years before 1900 may be represented.

SEE ALSO

 

time(2), times(2), utime(2), asctime(3C), clock(3C), clock_settime(3RT), ctime(3C), difftime(3C), getdate(3C), gmtime(3C), localtime(3C), mktime(3C), nanosleep(3RT), strftime(3C), strptime(3C), sysconf(3C), timer_create(3RT), timer_delete(3RT), timer_settime(3RT), tzset(3C)


SunOS 5.9Go To TopLast Changed 30 Jun 1998

 
      
      
Copyright 2002 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.