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 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303
|
<HTML>
<head><title>wxTime</title></head>
<BODY BGCOLOR=#FFFFFF>
<A NAME="wxtime"></A><CENTER>
<A HREF="wx.htm"><img align=center src="contents.gif" BORDER=0 ALT="Contents"></A> <A HREF="wx22.htm#classref"><img align=center src="up.gif" BORDER=0 ALT="Up"></A> <A HREF="wx246.htm#wxthread"><img align=center src="back.gif" BORDER=0 ALT="Previous"></A> <A HREF="wx248.htm#wxtimer"><img align=center src="forward.gif" BORDER=0 ALT="Next"></A> </CENTER><HR>
<H2>wxTime</H2>
<P>
Representation of time and date.<P>
NOTE: this class should be
used with caution, since it is not fully tested. It will be replaced
with a new wxDateTime class in the near future.<P>
<B><FONT COLOR="#FF0000">Derived from</FONT></B><P>
<A HREF="wx158.htm#wxobject">wxObject</A><P>
<B><FONT COLOR="#FF0000">Include files</FONT></B><P>
<wx/time.h><P>
<B><FONT COLOR="#FF0000">Data structures</FONT></B><P>
<FONT SIZE=2><PRE>
typedef unsigned short hourTy;
</PRE>
</FONT><P>
<FONT SIZE=2><PRE>
typedef unsigned short minuteTy;
</PRE>
</FONT><P>
<FONT SIZE=2><PRE>
typedef unsigned short secondTy;
</PRE>
</FONT><P>
<FONT SIZE=2><PRE>
typedef unsigned long clockTy;
</PRE>
</FONT><P>
<FONT SIZE=2><PRE>
enum tFormat wx12h, wx24h ;
</PRE>
</FONT><P>
<FONT SIZE=2><PRE>
enum tPrecision wxStdMinSec, wxStdMin ;
</PRE>
</FONT><P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
wxDate (REF NOT FOUND)<P>
<B><FONT COLOR="#FF0000">Members</FONT></B><P>
<A HREF="#wxtimewxtime">wxTime::wxTime</A><BR>
<A HREF="#wxtimegetday">wxTime::GetDay</A><BR>
<A HREF="#wxtimegetdatofweek">wxTime::GetDayOfWeek</A><BR>
<A HREF="#wxtimegethour">wxTime::GetHour</A><BR>
<A HREF="#wxtimegethourgmt">wxTime::GetHourGMT</A><BR>
<A HREF="#wxtimegetminute">wxTime::GetMinute</A><BR>
<A HREF="#wxtimegetminutegmt">wxTime::GetMinuteGMT</A><BR>
<A HREF="#wxtimegetmonth">wxTime::GetMonth</A><BR>
<A HREF="#wxtimegetsecond">wxTime::GetSecond</A><BR>
<A HREF="#wxtimegetsecondgmt">wxTime::GetSecondGMT</A><BR>
<A HREF="#wxtimegetseconds">wxTime::GetSeconds</A><BR>
<A HREF="#wxtimegetyear">wxTime::GetYear</A><BR>
<A HREF="#wxtimeformattime">wxTime::FormatTime</A><BR>
<A HREF="#wxtimeisbetween">wxTime::IsBetween</A><BR>
<A HREF="#wxtimemax">wxTime::Max</A><BR>
<A HREF="#wxtimemin">wxTime::Min</A><BR>
<A HREF="#wxtimesetformat">wxTime::SetFormat</A><BR>
<A HREF="#wxtimestring">wxTime::operator char*</A><BR>
<A HREF="#wxtimewxdate">wxTime::operator wxDate</A><BR>
<A HREF="#wxtimeoperator">wxTime::operator =</A><BR>
<A HREF="#wxtimeoperatorle">wxTime::operator <</A><BR>
<A HREF="#wxtimeoperatorleq">wxTime::operator <=</A><BR>
<A HREF="#wxtimeoperatorge">wxTime::operator ></A><BR>
<A HREF="#wxtimeoperatorgeq">wxTime::operator >=</A><BR>
<A HREF="#wxtimeoperatoreq">wxTime::operator ==</A><BR>
<A HREF="#wxtimeoperatorneq">wxTime::operator !=</A><BR>
<A HREF="#wxtimeoperatorplus">wxTime::operator +</A><BR>
<A HREF="#wxtimeoperatorminus">wxTime::operator -</A><BR>
<A HREF="#wxtimeoperatorpluseq">wxTime::operator +=</A><BR>
<A HREF="#wxtimeoperatorminuseq">wxTime::operator -=</A><BR>
<P>
<HR>
<A NAME="wxtimewxtime"></A>
<H3>wxTime::wxTime</H3>
<P>
<B></B> <B>wxTime</B>()<P>
Initialize the object using the current time.<P>
<B></B> <B>wxTime</B>(<B>clockTy </B><I>s</I>)<P>
Initialize the object using the number of seconds that have elapsed since ???.<P>
<B></B> <B>wxTime</B>(<B>const wxTime&</B><I> time</I>)<P>
Copy constructor.<P>
<B></B> <B>wxTime</B>(<B>hourTy </B><I>h</I>, <B>minuteTy </B><I>m</I>, <B>secondTy </B><I>s = 0</I>, <B>bool </B><I>dst = FALSE</I>)<P>
Initialize using hours, minutes, seconds, and whether DST time.<P>
<B></B> <B>wxTime</B>(<B>const wxDate&</B><I> date</I>, <B>hourTy </B><I>h = 0</I>, <B>minuteTy </B><I>m = 0</I>, <B>secondTy </B><I>s = 0</I>, <B>bool </B><I>dst = FALSE</I>)<P>
Initialize using a <A HREF="wx64.htm#wxdate">wxDate</A> object, hours, minutes, seconds, and whether DST time.<P>
<HR>
<A NAME="wxtimegetday"></A>
<H3>wxTime::GetDay</H3>
<P>
<B>int</B> <B>GetDay</B>() <B>const</B><P>
Returns the day of the month.<P>
<HR>
<A NAME="wxtimegetdatofweek"></A>
<H3>wxTime::GetDayOfWeek</H3>
<P>
<B>int</B> <B>GetDayOfWeek</B>() <B>const</B><P>
Returns the day of the week, a number from 0 to 6 where 0 is Sunday and 6 is Saturday.<P>
<HR>
<A NAME="wxtimegethour"></A>
<H3>wxTime::GetHour</H3>
<P>
<B>hourTy</B> <B>GetHour</B>() <B>const</B><P>
Returns the hour in local time.<P>
<HR>
<A NAME="wxtimegethourgmt"></A>
<H3>wxTime::GetHourGMT</H3>
<P>
<B>hourTy</B> <B>GetHourGMT</B>() <B>const</B><P>
Returns the hour in GMT.<P>
<HR>
<A NAME="wxtimegetminute"></A>
<H3>wxTime::GetMinute</H3>
<P>
<B>minuteTy</B> <B>GetMinute</B>() <B>const</B><P>
Returns the minute in local time.<P>
<HR>
<A NAME="wxtimegetminutegmt"></A>
<H3>wxTime::GetMinuteGMT</H3>
<P>
<B>minuteTy</B> <B>GetMinuteGMT</B>() <B>const</B><P>
Returns the minute in GMT.<P>
<HR>
<A NAME="wxtimegetmonth"></A>
<H3>wxTime::GetMonth</H3>
<P>
<B>int</B> <B>GetMonth</B>() <B>const</B><P>
Returns the month.<P>
<HR>
<A NAME="wxtimegetsecond"></A>
<H3>wxTime::GetSecond</H3>
<P>
<B>secondTy</B> <B>GetSecond</B>() <B>const</B><P>
Returns the second in local time or GMT.<P>
<HR>
<A NAME="wxtimegetsecondgmt"></A>
<H3>wxTime::GetSecondGMT</H3>
<P>
<B>secondTy</B> <B>GetSecondGMT</B>() <B>const</B><P>
Returns the second in GMT.<P>
<HR>
<A NAME="wxtimegetseconds"></A>
<H3>wxTime::GetSeconds</H3>
<P>
<B>clockTy</B> <B>GetSeconds</B>() <B>const</B><P>
Returns the number of seconds since ???.<P>
<HR>
<A NAME="wxtimegetyear"></A>
<H3>wxTime::GetYear</H3>
<P>
<B>int</B> <B>GetYear</B>() <B>const</B><P>
Returns the year.<P>
<HR>
<A NAME="wxtimeformattime"></A>
<H3>wxTime::FormatTime</H3>
<P>
<B>char*</B> <B>FormatTime</B>() <B>const</B><P>
Formats the time according to the current formatting options: see <A HREF="wx247.htm#wxtimesetformat">wxTime::SetFormat</A>.<P>
<HR>
<A NAME="wxtimeisbetween"></A>
<H3>wxTime::IsBetween</H3>
<P>
<B>bool</B> <B>IsBetween</B>(<B>const wxTime& </B><I>a</I>, <B>const wxTime& </B><I>b</I>) <B>const</B><P>
Returns TRUE if this time is between the two given times.<P>
<HR>
<A NAME="wxtimemax"></A>
<H3>wxTime::Max</H3>
<P>
<B>wxTime</B> <B>Max</B>(<B>const wxTime& </B><I>time</I>) <B>const</B><P>
Returns the maximum of the two times.<P>
<HR>
<A NAME="wxtimemin"></A>
<H3>wxTime::Min</H3>
<P>
<B>wxTime</B> <B>Min</B>(<B>const wxTime& </B><I>time</I>) <B>const</B><P>
Returns the minimum of the two times.<P>
<HR>
<A NAME="wxtimesetformat"></A>
<H3>wxTime::SetFormat</H3>
<P>
<B>static void</B> <B>SetFormat</B>(<B>const tFormat</B><I> format = wx12h</I>,
<B>const tPrecision</B><I> precision = wxStdMinSec</I>)<P>
Sets the format and precision.<P>
<HR>
<A NAME="wxtimestring"></A>
<H3>wxTime::operator char*</H3>
<P>
<B>operator</B> <B>char*</B>()<P>
Returns a pointer to a static char* containing the formatted time.<P>
<HR>
<A NAME="wxtimewxdate"></A>
<H3>wxTime::operator wxDate</H3>
<P>
<B>operator</B> <B>wxDate</B>() <B>const</B><P>
Converts the wxTime into a wxDate.<P>
<HR>
<A NAME="wxtimeoperator"></A>
<H3>wxTime::operator =</H3>
<P>
<B>void</B> <B>operator =</B>(<B>const wxTime& </B><I>t</I>)<P>
Assignment operator.<P>
<HR>
<A NAME="wxtimeoperatorle"></A>
<H3>wxTime::operator <</H3>
<P>
<B>bool</B> <B>operator <</B>(<B>const wxTime& </B><I>t</I>) <B>const</B><P>
Less than operator.<P>
<HR>
<A NAME="wxtimeoperatorleq"></A>
<H3>wxTime::operator <=</H3>
<P>
<B>bool</B> <B>operator <=</B>(<B>const wxTime& </B><I>t</I>) <B>const</B><P>
Less than or equal to operator.<P>
<HR>
<A NAME="wxtimeoperatorge"></A>
<H3>wxTime::operator ></H3>
<P>
<B>bool</B> <B>operator ></B>(<B>const wxTime& </B><I>t</I>) <B>const</B><P>
Greater than operator.<P>
<HR>
<A NAME="wxtimeoperatorgeq"></A>
<H3>wxTime::operator >=</H3>
<P>
<B>bool</B> <B>operator >=</B>(<B>const wxTime& </B><I>t</I>) <B>const</B><P>
Greater than or equal to operator.<P>
<HR>
<A NAME="wxtimeoperatoreq"></A>
<H3>wxTime::operator ==</H3>
<P>
<B>bool</B> <B>operator ==</B>(<B>const wxTime& </B><I>t</I>) <B>const</B><P>
Equality operator.<P>
<HR>
<A NAME="wxtimeoperatorneq"></A>
<H3>wxTime::operator !=</H3>
<P>
<B>bool</B> <B>operator !=</B>(<B>const wxTime& </B><I>t</I>) <B>const</B><P>
Inequality operator.<P>
<HR>
<A NAME="wxtimeoperatorplus"></A>
<H3>wxTime::operator +</H3>
<P>
<B>bool</B> <B>operator +</B>(<B>long </B><I>sec</I>) <B>const</B><P>
Addition operator.<P>
<HR>
<A NAME="wxtimeoperatorminus"></A>
<H3>wxTime::operator -</H3>
<P>
<B>bool</B> <B>operator -</B>(<B>long </B><I>sec</I>) <B>const</B><P>
Subtraction operator.<P>
<HR>
<A NAME="wxtimeoperatorpluseq"></A>
<H3>wxTime::operator +=</H3>
<P>
<B>bool</B> <B>operator +=</B>(<B>long </B><I>sec</I>) <B>const</B><P>
Increment operator.<P>
<HR>
<A NAME="wxtimeoperatorminuseq"></A>
<H3>wxTime::operator -=</H3>
<P>
<B>bool</B> <B>operator -=</B>(<B>long </B><I>sec</I>) <B>const</B><P>
Decrement operator.<P>
</BODY></HTML>
|