]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/date.tex
Misc small changes
[wxWidgets.git] / docs / latex / wx / date.tex
1 \section{\class{wxDate}}\label{wxdate}
2
3 A class for manipulating dates.
4
5 {\bf NOTE:} this class is retained only for compatibility,
6 and has been replaced by \helpref{wxDateTime}{wxdatetime}. wxDate
7 may be withdrawn in future versions of wxWindows.
8
9 \wxheading{Derived from}
10
11 \helpref{wxObject}{wxobject}
12
13 \wxheading{Include files}
14
15 <wx/date.h>
16
17 \wxheading{See also}
18
19 \helpref{wxTime}{wxtime}
20
21 \latexignore{\rtfignore{\wxheading{Members}}}
22
23 \membersection{wxDate::wxDate}\label{wxdateconstr}
24
25 \func{}{wxDate}{\void}
26
27 Default constructor.
28
29 \func{}{wxDate}{\param{const wxDate\&}{ date}}
30
31 Copy constructor.
32
33 \func{}{wxDate}{\param{int}{ month}, \param{int}{ day}, \param{int}{ year}}
34
35 Constructor taking month, day and year.
36
37 \func{}{wxDate}{\param{long}{ julian}}
38
39 Constructor taking an integer representing the Julian date. This is the number of days since
40 1st January 4713 B.C., so to convert from the number of days since 1st January 1901,
41 construct a date for 1/1/1901, and add the number of days.
42
43 \func{}{wxDate}{\param{const wxString\& }{dateString}}
44
45 Constructor taking a string representing a date. This must be either the string TODAY, or of the
46 form {\tt MM/DD/YYYY} or {\tt MM-DD-YYYY}. For example:
47
48 \begin{verbatim}
49 wxDate date("11/26/1966");
50 \end{verbatim}
51
52 \wxheading{Parameters}
53
54 \docparam{date}{Date to copy.}
55
56 \docparam{month}{Month: a number between 1 and 12.}
57
58 \docparam{day}{Day: a number between 1 and 31.}
59
60 \docparam{year}{Year, such as 1995, 2005.}
61
62 \membersection{wxDate::\destruct{wxDate}}
63
64 \func{void}{\destruct{wxDate}}{\void}
65
66 Destructor.
67
68 \membersection{wxDate::AddMonths}\label{wxdateaddmonths}
69
70 \func{wxDate\&}{AddMonths}{\param{int}{ months=1}}
71
72 Adds the given number of months to the date, returning a reference to `this'.
73
74 \membersection{wxDate::AddWeeks}\label{wxdateaddweeks}
75
76 \func{wxDate\&}{AddWeeks}{\param{int}{ weeks=1}}
77
78 Adds the given number of weeks to the date, returning a reference to `this'.
79
80 \membersection{wxDate::AddYears}\label{wxdateaddyears}
81
82 \func{wxDate\&}{AddYears}{\param{int}{ years=1}}
83
84 Adds the given number of months to the date, returning a reference to `this'.
85
86 \membersection{wxDate::FormatDate}\label{wxdateformatdate}
87
88 \constfunc{wxString}{FormatDate}{\param{int}{ type=-1}}
89
90 Formats the date according to {\it type} if not -1, or according
91 to the current display type if -1.
92
93 \wxheading{Parameters}
94
95 \docparam{type}{-1 or one of:
96
97 \begin{twocollist}\itemsep=0pt
98 \twocolitem{wxDAY}{Format day only.}
99 \twocolitem{wxMONTH}{Format month only.}
100 \twocolitem{wxMDY}{Format MONTH, DAY, YEAR.}
101 \twocolitem{wxFULL}{Format day, month and year in US style: DAYOFWEEK, MONTH, DAY, YEAR.}
102 \twocolitem{wxEUROPEAN}{Format day, month and year in European style: DAY, MONTH, YEAR.}
103 \end{twocollist}}
104
105 \membersection{wxDate::GetDay}\label{wxdategetday}
106
107 \constfunc{int}{GetDay}{\void}
108
109 Returns the numeric day (in the range 1 to 31).
110
111 \membersection{wxDate::GetDayOfWeek}\label{wxdategetdayofweek}
112
113 \constfunc{int}{GetDayOfWeek}{\void}
114
115 Returns the integer day of the week (in the range 1 to 7).
116
117 \membersection{wxDate::GetDayOfWeekName}\label{wxdategetdayofweekname}
118
119 \constfunc{wxString}{GetDayOfWeekName}{\void}
120
121 Returns the name of the day of week.
122
123 \membersection{wxDate::GetDayOfYear}\label{wxdategetdayofyear}
124
125 \constfunc{long}{GetDayOfYear}{\void}
126
127 Returns the day of the year (from 1 to 365).
128
129 \membersection{wxDate::GetDaysInMonth}\label{wxdategetdaysinmonth}
130
131 \constfunc{int}{GetDaysInMonth}{\void}
132
133 Returns the number of days in the month (in the range 1 to 31).
134
135 \membersection{wxDate::GetFirstDayOfMonth}\label{wxdategetfirstdayofmonth}
136
137 \constfunc{int}{GetFirstDayOfMonth}{\void}
138
139 Returns the day of week that is first in the month (in the range 1 to 7).
140
141 \membersection{wxDate::GetJulianDate}\label{wxdategetjuliandate}
142
143 \constfunc{long}{GetJulianDate}{\void}
144
145 Returns the Julian date.
146
147 \membersection{wxDate::GetMonth}\label{wxdategetmonth}
148
149 \constfunc{int}{GetMonth}{\void}
150
151 Returns the month number (in the range 1 to 12).
152
153 \membersection{wxDate::GetMonthEnd}
154
155 \func{wxDate}{GetMonthEnd}{\void}
156
157 Returns the date representing the last day of the month.
158
159 \membersection{wxDate::GetMonthName}\label{wxdategetmonthname}
160
161 \constfunc{wxString}{GetMonthName}{\void}
162
163 Returns the name of the month. Do not delete the returned storage.
164
165 \membersection{wxDate::GetMonthStart}\label{wxdategetmonthstart}
166
167 \constfunc{wxDate}{GetMonthStart}{\void}
168
169 Returns the date representing the first day of the month.
170
171 \membersection{wxDate::GetWeekOfMonth}\label{wxdategetweekofmonth}
172
173 \constfunc{int}{GetWeekOfMonth}{\void}
174
175 Returns the week of month (in the range 1 to 6).
176
177 \membersection{wxDate::GetWeekOfYear}\label{wxdategetweekofyear}
178
179 \constfunc{int}{GetWeekOfYear}{\void}
180
181 Returns the week of year (in the range 1 to 52).
182
183 \membersection{wxDate::GetYear}\label{wxdategetyear}
184
185 \constfunc{int}{GetYear}{\void}
186
187 Returns the year as an integer (such as `1995').
188
189 \membersection{wxDate::GetYearEnd}\label{wxdategetyearend}
190
191 \constfunc{wxDate}{GetYearEnd}{\void}
192
193 Returns the date representing the last day of the year.
194
195 \membersection{wxDate::GetYearStart}\label{wxdategetyearstart}
196
197 \constfunc{wxDate}{GetYearStart}{\void}
198
199 Returns the date representing the first day of the year.
200
201 \membersection{wxDate::IsLeapYear}\label{wxdateisleapyear}
202
203 \constfunc{bool}{IsLeapYear}{\void}
204
205 Returns TRUE if the year of this date is a leap year.
206
207 \membersection{wxDate::Set}\label{wxdateset}
208
209 \func{wxDate\&}{Set}{\void}
210
211 Sets the date to current system date, returning a reference to `this'.
212
213 \func{wxDate\&}{Set}{\param{long}{ julian}}
214
215 Sets the date to the given Julian date, returning a reference to `this'.
216
217 \func{wxDate\&}{Set}{\param{int}{ month}, \param{int}{ day}, \param{int}{ year}}
218
219 Sets the date to the given date, returning a reference to `this'.
220
221 {\it month} is a number from 1 to 12.
222
223 {\it day} is a number from 1 to 31.
224
225 {\it year} is a year, such as 1995, 2005.
226
227 \membersection{wxDate::SetFormat}\label{wxdatesetformat}
228
229 \func{void}{SetFormat}{\param{int}{ format}}
230
231 Sets the current format type.
232
233 \wxheading{Parameters}
234
235 \docparam{format}{-1 or one of:
236
237 \twocolwidtha{5cm}
238 \begin{twocollist}\itemsep=0pt
239 \twocolitem{{\bf wxDAY}}{Format day only.}
240 \twocolitem{{\bf wxMONTH}}{Format month only.}
241 \twocolitem{{\bf wxMDY}}{Format MONTH, DAY, YEAR.}
242 \twocolitem{{\bf wxFULL}}{Format day, month and year in US style: DAYOFWEEK, MONTH, DAY, YEAR.}
243 \twocolitem{{\bf wxEUROPEAN}}{Format day, month and year in European style: DAY, MONTH, YEAR.}
244 \end{twocollist}}
245
246 \membersection{wxDate::SetOption}\label{wxdatesetoption}
247
248 \func{int}{SetOption}{\param{int}{ option}, \param{const bool}{ enable=TRUE}}
249
250 Enables or disables an option for formatting.
251
252 \wxheading{Parameters}
253
254 \docparam{option}{May be one of:
255
256 \twocolwidtha{5cm}
257 \begin{twocollist}\itemsep=0pt
258 \twocolitem{{\bf wxNO\_CENTURY}}{The century is not formatted.}
259 \twocolitem{{\bf wxDATE\_ABBR}}{Month and day names are abbreviated to 3 characters when formatting.}
260 \end{twocollist}}
261
262 \membersection{wxDate::operator wxString}\label{wxdatewxstring}
263
264 \func{}{operator wxString}{\void}
265
266 Conversion operator, to convert wxDate to wxString by calling FormatDate.
267
268 \membersection{wxDate::operator $+$}\label{wxdateplus}
269
270 \func{wxDate}{operator $+$}{\param{long}{ i}}
271
272 \func{wxDate}{operator $+$}{\param{int}{ i}}
273
274 Adds an integer number of days to the date, returning a date.
275
276 \membersection{wxDate::operator $-$}\label{wxdateminus}
277
278 \func{wxDate}{operator $-$}{\param{long}{ i}}
279
280 \func{wxDate}{operator $-$}{\param{int}{ i}}
281
282 Subtracts an integer number of days from the date, returning a date.
283
284 \func{long}{operator $-$}{\param{const wxDate\&}{ date}}
285
286 Subtracts one date from another, return the number of intervening days.
287
288 \membersection{wxDate::operator $+=$}\label{wxdateplusequals}
289
290 \func{wxDate\&}{operator $+=$}{\param{long}{ i}}
291
292 Postfix operator: adds an integer number of days to the date, returning
293 a reference to `this' date.
294
295 \membersection{wxDate::operator $-=$}\label{wxdateminusequals}
296
297 \func{wxDate\&}{operator $-=$}{\param{long}{ i}}
298
299 Postfix operator: subtracts an integer number of days from the date, returning
300 a reference to `this' date.
301
302 \membersection{wxDate::operator $++$}\label{wxdateplusplus}
303
304 \func{wxDate\&}{operator $++$}{\void}
305
306 Increments the date (postfix or prefix).
307
308 \membersection{wxDate::operator $--$}\label{wxdateminusminus}
309
310 \func{wxDate\&}{operator $--$}{\void}
311
312 Decrements the date (postfix or prefix).
313
314 \membersection{wxDate::operator $<$}\label{wxdatelessthan}
315
316 \func{friend bool}{operator $<$}{\param{const wxDate\&}{ date1}, \param{const wxDate\&}{ date2}}
317
318 Function to compare two dates, returning TRUE if {\it date1} is earlier than {\it date2}.
319
320 \membersection{wxDate::operator $<=$}\label{wxdatelessthaneq}
321
322 \func{friend bool}{operator $<=$}{\param{const wxDate\&}{ date1}, \param{const wxDate\&}{ date2}}
323
324 Function to compare two dates, returning TRUE if {\it date1} is earlier than or equal to {\it date2}.
325
326 \membersection{wxDate::operator $>$}\label{wxdategreaterthan}
327
328 \func{friend bool}{operator $>$}{\param{const wxDate\&}{ date1}, \param{const wxDate\&}{ date2}}
329
330 Function to compare two dates, returning TRUE if {\it date1} is later than {\it date2}.
331
332 \membersection{wxDate::operator $>=$}\label{wxdategreaterthaneq}
333
334 \func{friend bool}{operator $>=$}{\param{const wxDate\&}{ date1}, \param{const wxDate\&}{ date2}}
335
336 Function to compare two dates, returning TRUE if {\it date1} is later than or equal to {\it date2}.
337
338 \membersection{wxDate::operator $==$}\label{wxdateequals}
339
340 \func{friend bool}{operator $==$}{\param{const wxDate\&}{ date1}, \param{const wxDate\&}{ date2}}
341
342 Function to compare two dates, returning TRUE if {\it date1} is equal to {\it date2}.
343
344 \membersection{wxDate::operator $!=$}\label{wxdatenotequals}
345
346 \func{friend bool}{operator $!=$}{\param{const wxDate\&}{ date1}, \param{const wxDate\&}{ date2}}
347
348 Function to compare two dates, returning TRUE if {\it date1} is not equal to {\it date2}.
349
350 \membersection{wxDate::operator \cinsert}\label{wxdateinsert}
351
352 \func{friend ostream\&}{operator \cinsert}{\param{ostream\&}{ os}, \param{const wxDate\&}{ date}}
353
354 Function to output a wxDate to an ostream.
355
356