4 * Date and time functions and types.
6 * This file is part of the Mingw32 package.
9 * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
11 * THIS SOFTWARE IS NOT COPYRIGHTED
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAIMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
26 /* Appropriated for Reactos Crtdll by Ariadne */
30 #define __need_wchar_t
32 #include <msvcrt/stddef.h>
36 * Number of clock ticks per second. A clock tick is the unit by which
37 * processor time is measured and is returned by 'clock'.
39 #define CLOCKS_PER_SEC 1000.0
40 #define CLK_TICK CLOCKS_PER_SEC
44 * Need a definition of time_t.
46 #include <msvcrt/sys/types.h>
49 * A type for storing the current time and date. This is the number of
50 * seconds since midnight Jan 1, 1970.
51 * NOTE: Normally this is defined by the above include of sys/types.h
59 * A type for measuring processor time (in clock ticks).
67 * A structure for storing all kinds of useful information about the
68 * current (or another) time.
72 int tm_sec; /* Seconds: 0-59 (K&R says 0-61?) */
73 int tm_min; /* Minutes: 0-59 */
74 int tm_hour; /* Hours since midnight: 0-23 */
75 int tm_mday; /* Day of the month: 1-31 */
76 int tm_mon; /* Months *since* january: 0-11 */
77 int tm_year; /* Years since 1900 */
78 int tm_wday; /* Days since Sunday (0-6) */
79 int tm_yday; /* Days since Jan. 1: 0-365 */
80 int tm_isdst; /* +1 Daylight Savings Time, 0 No DST,
92 double difftime(time_t, time_t);
93 time_t mktime(struct tm*);
96 * These functions write to and return pointers to static buffers that may
97 * be overwritten by other function calls. Yikes!
99 * NOTE: localtime, and perhaps the others of the four functions grouped
100 * below may return NULL if their argument is not 'acceptable'. Also note
101 * that calling asctime with a NULL pointer will produce an Invalid Page
102 * Fault and crap out your program. Guess how I know. Hint: stat called on
103 * a directory gives 'invalid' times in st_atime etc...
105 char* asctime(const struct tm*);
106 char* ctime(const time_t*);
107 struct tm* gmtime(const time_t*);
108 struct tm* localtime(const time_t*);
110 size_t strftime(char*, size_t, const char*, const struct tm*);
111 size_t wcsftime(wchar_t*, size_t, const wchar_t*, const struct tm*);
113 wchar_t* _wasctime(const struct tm *timeptr);
114 wchar_t* _wctime(const time_t * const timep);
115 char* _strdate(const char *datestr);
116 wchar_t* _wstrdate(const wchar_t *datestr);
117 char* _strtime(char* buf);
118 wchar_t* _wstrtime(wchar_t* buf);
124 #endif /* Not _TIME_H_ */