time.h是C/C++中的日期和时间头文件。用于需要时间方面的函数。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
/* time.h Struct and function declarations for dealing with time. */ /* * C/C++ Run Time Library - Version 11.0 * * Copyright (c) 1987, 2002 by Borland Software Corporation * All Rights Reserved. * */ /* $Revision: 9.13.2.1 $ */ #ifndef __TIME_H #define __TIME_H #define _INC_TIME /* MSC Guard name */ #include <_stddef.h> #ifdef __cplusplus namespace std { #endif /* __cplusplus */ #if !defined(RC_INVOKED) #if defined(__STDC__) #pragma warn -nak #endif #pragma pack(push, 1) #endif /* !RC_INVOKED */ #ifndef _TIME_T typedef long time_t; #ifdef __cplusplus # define _TIME_T std::time_t #else # define _TIME_T time_t #endif /* __cplusplus */ #endif #ifndef _CLOCK_T #define _CLOCK_T typedef long clock_t; #endif #define CLOCKS_PER_SEC 1000.0 #define CLK_TCK 1000.0 struct tm { int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_yday; int tm_isdst; }; #ifdef __cplusplus extern "C" { #endif char * _RTLENTRY _EXPFUNC asctime(const struct tm *__tblock); char * _RTLENTRY _EXPFUNC ctime(const time_t *__time); double _RTLENTRY _EXPFUNC difftime(time_t __time2, time_t __time1); struct tm * _RTLENTRY _EXPFUNC gmtime(const time_t *__timer); struct tm * _RTLENTRY _EXPFUNC localtime(const time_t *__timer); time_t _RTLENTRY _EXPFUNC time(time_t *__timer); time_t _RTLENTRY _EXPFUNC mktime(struct tm *__timeptr); clock_t _RTLENTRY _EXPFUNC clock(void); _SIZE_T _RTLENTRY _EXPFUNC strftime(char *__s, _SIZE_T __maxsize, const char *__fmt, const struct tm *__t); char * _RTLENTRY _EXPFUNC strptime(const char *__s, const char *__fmt, struct tm *__t); _SIZE_T _RTLENTRY _EXPFUNC _lstrftim(char *__s, _SIZE_T __maxsize, const char *__fmt, const struct tm *__t); wchar_t * _RTLENTRY _EXPFUNC _wasctime(const struct tm *__tblock); wchar_t * _RTLENTRY _EXPFUNC _wctime(const time_t *__time); wchar_t * _RTLENTRY _EXPFUNC _wstrdate(wchar_t *__datestr); wchar_t * _RTLENTRY _EXPFUNC _wstrtime(wchar_t *__timestr); _SIZE_T _RTLENTRY _EXPFUNC wcsftime(wchar_t *__s, _SIZE_T __maxsize, const wchar_t *__fmt, const struct tm *__t); void _RTLENTRY _EXPFUNC _wtzset(void); extern int _RTLENTRY _EXPDATA _daylight; extern long _RTLENTRY _EXPDATA _timezone; extern char * const _RTLENTRY _EXPDATA _tzname[2]; extern wchar_t * const _RTLENTRY _EXPDATA _wtzname[2]; int _RTLENTRY stime(time_t *__tp); void _RTLENTRY _EXPFUNC _tzset(void); char * _RTLENTRY _EXPFUNC _strdate(char *__datestr); char * _RTLENTRY _EXPFUNC _strtime(char *__timestr); #if !defined(__STDC__) void _RTLENTRY _EXPFUNC tzset(void); /* MSC compatible routines: */ unsigned int _RTLENTRY _EXPFUNC _getsystime(struct tm *__timeptr); unsigned int _RTLENTRY _EXPFUNC _setsystime(struct tm *__timeptr, unsigned int __ms); #endif /* __STDC__ */ #ifdef __cplusplus } #endif #if !defined(RC_INVOKED) /* restore default packing */ #pragma pack(pop) #if defined(__STDC__) #pragma warn .nak #endif #endif /* !RC_INVOKED */ #ifdef __cplusplus } // std #endif #endif /* __TIME_H */ #if defined(__cplusplus) && !defined(__USING_CNAME__) && !defined(__TIME_H_USING_LIST) #define __TIME_H_USING_LIST using std::time_t; using std::clock_t; using std::tm; using std::asctime; using std::ctime; using std::difftime; using std::gmtime; using std::localtime; using std::time; using std::mktime; using std::clock; using std::strftime; using std::strptime; using std::_lstrftim; using std::_wasctime; using std::_wctime; using std::_wstrdate; using std::_wstrtime; using std::wcsftime; using std::_wtzset; using std::stime; using std::_tzset; using std::_strdate; using std::_strtime; using std::_daylight; using std::_timezone; using std::_tzname; using std::_wtzname; #if !defined(__STDC__) using std::tzset; using std::_getsystime; using std::_setsystime; #endif #endif /* __USING_CNAME__ */ |