1 /* Date and time <time.h>
3 This file is part of the Public Domain C Library (PDCLib).
4 Permission is granted to use, modify, and / or redistribute at will.
8 #define _PDCLIB_TIME_H _PDCLIB_TIME_H
9 #include <_PDCLIB_aux.h>
10 #include <_PDCLIB_int.h>
16 #ifndef _PDCLIB_SIZE_T_DEFINED
17 #define _PDCLIB_SIZE_T_DEFINED _PDCLIB_SIZE_T_DEFINED
18 typedef _PDCLIB_size_t size_t;
21 #ifndef _PDCLIB_NULL_DEFINED
22 #define _PDCLIB_NULL_DEFINED _PDCLIB_NULL_DEFINED
23 #define NULL _PDCLIB_NULL
26 typedef _PDCLIB_time_t time_t;
27 typedef _PDCLIB_clock_t clock_t;
29 #define CLOCKS_PER_SEC _PDCLIB_CLOCKS_PER_SEC
30 #define TIME_UTC _PDCLIB_TIME_UTC
40 int tm_sec; /* 0-60 */
41 int tm_min; /* 0-59 */
42 int tm_hour; /* 0-23 */
43 int tm_mday; /* 1-31 */
44 int tm_mon; /* 0-11 */
45 int tm_year; /* years since 1900 */
46 int tm_wday; /* 0-6 */
47 int tm_yday; /* 0-365 */
48 int tm_isdst; /* >0 DST, 0 no DST, <0 information unavailable */
51 /* Returns the number of "clocks" in processor time since the invocation
52 of the program. Divide by CLOCKS_PER_SEC to get the value in seconds.
53 Returns -1 if the value cannot be represented in the return type or is
56 clock_t clock( void ) _PDCLIB_nothrow;
58 /* Returns the difference between two calendar times in seconds. */
59 double difftime( time_t time1, time_t time0 ) _PDCLIB_nothrow;
61 time_t mktime( struct tm * timeptr ) _PDCLIB_nothrow;
63 time_t time( time_t * timer ) _PDCLIB_nothrow;
65 int timespec_get( struct timespec * ts, int base ) _PDCLIB_nothrow;
67 char * asctime( const struct tm * timeptr ) _PDCLIB_nothrow;
69 char * ctime( const time_t * timer ) _PDCLIB_nothrow;
71 struct tm * gmtime( const time_t * timer ) _PDCLIB_nothrow;
73 struct tm * localtime( const time_t * timer ) _PDCLIB_nothrow;
75 size_t strftime( char * _PDCLIB_restrict s, size_t maxsize, const char * _PDCLIB_restrict format, const struct tm * _PDCLIB_restrict timeptr );