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