include/time.h File Reference

#include <sys/types.h>

Include dependency graph for time.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  tm
 Broken down time information. More...

Defines

#define _ABLE_CLIB_TIME_H   1
#define CLOCKS_PER_SEC   1000000l
#define difftime(t1, t0)   (double)(t1 - t0)

Typedefs

typedef unsigned long clock_t

Functions

clock_t clock (void)
char * asctime (const struct tm *tm)
char * asctime_r (const struct tm *tm, char *buf)
char * ctime (const time_t *timep)
char * ctime_r (const time_t *timep, char *buf)
struct tmgmtime (const time_t *timep)
struct tmgmtime_r (const time_t *timep, struct tm *result)
struct tmlocaltime (const time_t *timep)
struct tmlocaltime_r (const time_t *timep, struct tm *result)
time_t mktime (struct tm *tm)
 Convert contents of a tm struct to a time_t.
size_t strftime (char *s, size_t max, const char *format, const struct tm *tm)
 Pretty print time and date from a tm struct.
time_t time (time_t *t)
 Returns the seconds since the Epoch (00:00:00 1/1/1970).


Define Documentation

#define _ABLE_CLIB_TIME_H   1

#define CLOCKS_PER_SEC   1000000l

#define difftime ( t1,
t0   )     (double)(t1 - t0)


Typedef Documentation

typedef unsigned long clock_t


Function Documentation

char* asctime ( const struct tm tm  ) 

char* asctime_r ( const struct tm tm,
char *  buf 
)

clock_t clock ( void   ) 

char* ctime ( const time_t timep  ) 

char* ctime_r ( const time_t timep,
char *  buf 
)

struct tm* gmtime ( const time_t timep  )  [read]

struct tm* gmtime_r ( const time_t timep,
struct tm result 
) [read]

struct tm* localtime ( const time_t timep  )  [read]

struct tm* localtime_r ( const time_t timep,
struct tm result 
) [read]

time_t mktime ( struct tm tm  ) 

Convert contents of a tm struct to a time_t.

Standard conversion from a tm struct to a number of seconds from the UNIX epoch (1970). The tm struct has years specified since an epoch of 1900, time_t has an epoch of 1970 and the Gregorian calender is based on an epoch of 1. To account for all the various leap days and reconcile these three epoch this routine converts the date to a number of days since Gregorian epoch and then subtracts from that to get the number of days since the UNIX epoch.

Parameters:
tm The broken down time to convert.
Returns:
The number of seconds since the UNIX epoch (1970).

size_t strftime ( char *  s,
size_t  max,
const char *  format,
const struct tm tm 
)

Pretty print time and date from a tm struct.

Produces a string representing a given time and date. The output string is controlled by a format specifier which consists of verbatim text which is simply copied out and % signs which introduce a part of the date or time.

The format string syntax is somewhat complicated and is generally identical to the POSIX define function of the same name. A limited number of format specifiers are not correct in this implementation.

Parameters:
s The string to place output in.
max The maximum length of the string s.
format The format specifier.
tm The structure containing the time to convert.
Returns:
The length of the string written.

time_t time ( time_t t  ) 

Returns the seconds since the Epoch (00:00:00 1/1/1970).

Parameters:
t If not NULL the return value is also stored here.
Returns:
On success, the value of time in seconds since the Epoch is returned. On error, ((time_t)-1) is returned, and errno is set appropriately.


Generated on Tue Jan 20 14:29:00 2009 for ABLE LIBC by  doxygen 1.5.6