Root/
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 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- Syntax highlighting generated by Web C Plus Plus software v0.8.4 Webcpp Copyright (C)2001-2004 Jeffrey Bakker under the GNU GPL Get webcpp at http://webcpp.sf.net --> < html > < head > < title >ptime.h</ title > < style type = "text/css" > /* Webcpp v0.8.1 compatible StyleSheet Theme: ide-msvcpp */ body { background-color: #ffffff } .webcpp a:link {color:#000000} .webcpp a:visited {color:#008000} .webcpp a:active {color:#0000ff} .webcpp a:hover {color:#0000ff} .webcpp pre { color: #000000 } .webcpp font { font-size:100% } .webcpp .symbols { color: #000000 } .webcpp .preproc { color: #0000ff } .webcpp .integer { color: #000000 } .webcpp .floatpt { color: #000000 } .webcpp .dblquot { color: #000000 } .webcpp .sinquot { color: #000000 } .webcpp .keyword { color: #0000ff; } .webcpp .keytype { color: #0000ff; } .webcpp .comment { color: #008000; } </ style > </ head > < body bgcolor = "#FFFFFF" leftmargin = "40" marginwidth = "40" > < p >< a href = "../htsrc.html" >Index</ a >< hr noshade></ p > < div class = "webcpp" > < pre > < font CLASS = preproc >#ifndef</ font > __PTIME_H__ < font CLASS = preproc >#define</ font > __PTIME_H__ < font CLASS = preproc >#ifndef</ font > __PPORT_H__ < font CLASS = preproc >#include</ font > < font CLASS = dblquot >"pport.h"</ font > < font CLASS = preproc >#endif</ font > < font CLASS = preproc >#ifndef</ font > __PTYPES_H__ < font CLASS = preproc >#include</ font > < font CLASS = dblquot >"ptypes.h"</ font > < font CLASS = preproc >#endif</ font > < font CLASS = preproc >#include</ font > < time.h > PTYPES_BEGIN < font CLASS = comment >// datetime type: 64-bit, number of milliseconds since midnight 01/01/0001</ font > < font CLASS = keyword >typedef</ font > large datetime; < font CLASS = preproc >#define</ font > invdatetime LLCONST(< font CLASS = symbols >-</ font >< font CLASS = integer >1</ font >) < font CLASS = preproc >#define</ font > _msecsmax < font CLASS = integer >86400000</ font > < font CLASS = comment >// number of milliseconds in one day </ font > < font CLASS = preproc >#define</ font > _daysmax < font CLASS = integer >3652059</ font > < font CLASS = comment >// number of days between 01/01/0001 and 12/31/9999 </ font > < font CLASS = preproc >#define</ font > _datetimemax LLCONST(< font CLASS = integer >315537897600000</ font >) < font CLASS = comment >// max. allowed number for datetime type </ font > < font CLASS = preproc >#define</ font > _unixepoch LLCONST(< font CLASS = integer >62135596800000</ font >) < font CLASS = comment >// difference between time_t and datetime in milliseconds </ font > < font CLASS = comment >// datetime general utilities</ font > < font CLASS = keyword >inline</ font > < font CLASS = keytype >int</ font > days(datetime d) { < font CLASS = keyword >return</ font > < font CLASS = keytype >int</ font >(d / _msecsmax); } < font CLASS = keyword >inline</ font > < font CLASS = keytype >int</ font > msecs(datetime d) { < font CLASS = keyword >return</ font > < font CLASS = keytype >int</ font >(d % _msecsmax); } datetime mkdt(< font CLASS = keytype >int</ font > days, < font CLASS = keytype >int</ font > msecs); < font CLASS = keytype >bool</ font > isvalid(datetime); datetime now(< font CLASS = keytype >bool</ font > utc < font CLASS = symbols >=</ font > < font CLASS = keyword >true</ font >); < font CLASS = keytype >void</ font > tzupdate(); < font CLASS = keytype >int</ font > tzoffset(); string dttostring(datetime, < font CLASS = keyword >const</ font > < font CLASS = keytype >char</ font >* fmt); string nowstring(< font CLASS = keyword >const</ font > < font CLASS = keytype >char</ font >* fmt, < font CLASS = keytype >bool</ font > utc < font CLASS = symbols >=</ font > < font CLASS = keyword >true</ font >); datetime utodatetime(time_t u); < font CLASS = keyword >struct</ font > tm* dttotm(datetime dt, < font CLASS = keyword >struct</ font > tm& t); < font CLASS = comment >// date/calendar manipulation</ font > < font CLASS = keytype >bool</ font > isleapyear(< font CLASS = keytype >int</ font > year); < font CLASS = keytype >int</ font > daysinmonth(< font CLASS = keytype >int</ font > year, < font CLASS = keytype >int</ font > month); < font CLASS = keytype >int</ font > daysinyear(< font CLASS = keytype >int</ font > year, < font CLASS = keytype >int</ font > month); < font CLASS = keytype >int</ font > dayofweek(datetime); < font CLASS = keytype >bool</ font > isdatevalid(< font CLASS = keytype >int</ font > year, < font CLASS = keytype >int</ font > month, < font CLASS = keytype >int</ font > day); datetime encodedate(< font CLASS = keytype >int</ font > year, < font CLASS = keytype >int</ font > month, < font CLASS = keytype >int</ font > day); < font CLASS = keytype >bool</ font > decodedate(datetime, < font CLASS = keytype >int</ font >& year, < font CLASS = keytype >int</ font >& month, < font CLASS = keytype >int</ font >& day); < font CLASS = comment >// time manipulation</ font > < font CLASS = keytype >bool</ font > istimevalid(< font CLASS = keytype >int</ font > hour, < font CLASS = keytype >int</ font > min, < font CLASS = keytype >int</ font > sec, < font CLASS = keytype >int</ font > msec < font CLASS = symbols >=</ font > < font CLASS = integer >0</ font >); datetime encodetime(< font CLASS = keytype >int</ font > hour, < font CLASS = keytype >int</ font > min, < font CLASS = keytype >int</ font > sec, < font CLASS = keytype >int</ font > msec < font CLASS = symbols >=</ font > < font CLASS = integer >0</ font >); < font CLASS = keytype >bool</ font > decodetime(datetime, < font CLASS = keytype >int</ font >& hour, < font CLASS = keytype >int</ font >& min, < font CLASS = keytype >int</ font >& sec, < font CLASS = keytype >int</ font >& msec); < font CLASS = keytype >bool</ font > decodetime(datetime, < font CLASS = keytype >int</ font >& hour, < font CLASS = keytype >int</ font >& min, < font CLASS = keytype >int</ font >& sec); PTYPES_END < font CLASS = preproc >#endif</ font > < font CLASS = comment >// __PTIME_H__ </ font > </ pre > </ div > < hr noshade></ body > </ html > |
Source at commit tip created 11 years 11 months ago. By Nathan Adams, Updating makefile |
---|