1 \section{\class{wxDate
}}\label{wxdate
}
3 A class for manipulating dates.
5 NOTE: this class should be
6 used with caution, since it is not fully tested. It may be replaced
7 with a new class in the near future.
9 \wxheading{Derived from
}
11 \helpref{wxObject
}{wxobject
}
15 \helpref{wxTime
}{wxtime
}
17 \latexignore{\rtfignore{\wxheading{Members
}}}
19 \membersection{wxDate::wxDate
}\label{wxdateconstr
}
21 \func{}{wxDate
}{\void}
25 \func{}{wxDate
}{\param{const wxDate\&
}{ date
}}
29 \func{}{wxDate
}{\param{int
}{ month
},
\param{int
}{ day
},
\param{int
}{ year
}}
31 Constructor taking month, day and year.
33 \func{}{wxDate
}{\param{long
}{ julian
}}
35 Constructor taking an integer representing the Julian date. This is the number of days since
36 1st January
4713 B.C., so to convert from the number of days since
1st January
1901,
37 construct a date for
1/
1/
1901, and add the number of days.
39 \func{}{wxDate
}{\param{const wxString\&
}{dateString
}}
41 Constructor taking a string representing a date. This must be either the string TODAY, or of the
42 form
{\tt MM/DD/YYYY
} or
{\tt MM-DD-YYYY
}. For example:
45 wxDate date("
11/
26/
1966");
48 \wxheading{Parameters
}
50 \docparam{date
}{Date to copy.
}
52 \docparam{month
}{Month: a number between
1 and
12.
}
54 \docparam{day
}{Day: a number between
1 and
31.
}
56 \docparam{year
}{Year, such as
1995,
2005.
}
58 \membersection{wxDate::
\destruct{wxDate
}}
60 \func{void
}{\destruct{wxDate
}}{\void}
64 \membersection{wxDate::AddMonths
}\label{wxdateaddmonths
}
66 \func{wxDate\&
}{AddMonths
}{\param{int
}{ months=
1}}
68 Adds the given number of months to the date, returning a reference to `this'.
70 \membersection{wxDate::AddWeeks
}\label{wxdateaddweeks
}
72 \func{wxDate\&
}{AddWeeks
}{\param{int
}{ weeks=
1}}
74 Adds the given number of weeks to the date, returning a reference to `this'.
76 \membersection{wxDate::AddYears
}\label{wxdateaddyears
}
78 \func{wxDate\&
}{AddYears
}{\param{int
}{ years=
1}}
80 Adds the given number of months to the date, returning a reference to `this'.
82 \membersection{wxDate::FormatDate
}\label{wxdateformatdate
}
84 \constfunc{wxString
}{FormatDate
}{\param{int
}{ type=-
1}}
86 Formats the date according to
{\it type
} if not -
1, or according
87 to the current display type if -
1.
89 \wxheading{Parameters
}
91 \docparam{type
}{-
1 or one of:
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.
}
101 \membersection{wxDate::GetDay
}\label{wxdategetday
}
103 \constfunc{int
}{GetDay
}{\void}
105 Returns the numeric day (in the range
1 to
31).
107 \membersection{wxDate::GetDayOfWeek
}\label{wxdategetdayofweek
}
109 \constfunc{int
}{GetDayOfWeek
}{\void}
111 Returns the integer day of the week (in the range
1 to
7).
113 \membersection{wxDate::GetDayOfWeekName
}\label{wxdategetdayofweekname
}
115 \constfunc{wxString
}{GetDayOfWeekName
}{\void}
117 Returns the name of the day of week.
119 \membersection{wxDate::GetDayOfYear
}\label{wxdategetdayofyear
}
121 \constfunc{long
}{GetDayOfYear
}{\void}
123 Returns the day of the year (from
1 to
365).
125 \membersection{wxDate::GetDaysInMonth
}\label{wxdategetdaysinmonth
}
127 \constfunc{int
}{GetDaysInMonth
}{\void}
129 Returns the number of days in the month (in the range
1 to
31).
131 \membersection{wxDate::GetFirstDayOfMonth
}\label{wxdategetfirstdayofmonth
}
133 \constfunc{int
}{GetFirstDayOfMonth
}{\void}
135 Returns the day of week that is first in the month (in the range
1 to
7).
137 \membersection{wxDate::GetJulianDate
}\label{wxdategetjuliandate
}
139 \constfunc{long
}{GetJulianDate
}{\void}
141 Returns the Julian date.
143 \membersection{wxDate::GetMonth
}\label{wxdategetmonth
}
145 \constfunc{int
}{GetMonth
}{\void}
147 Returns the month number (in the range
1 to
12).
149 \membersection{wxDate::GetMonthEnd
}
151 \func{wxDate
}{GetMonthEnd
}{\void}
153 Returns the date representing the last day of the month.
155 \membersection{wxDate::GetMonthName
}\label{wxdategetmonthname
}
157 \constfunc{wxString
}{GetMonthName
}{\void}
159 Returns the name of the month. Do not delete the returned storage.
161 \membersection{wxDate::GetMonthStart
}\label{wxdategetmonthstart
}
163 \constfunc{wxDate
}{GetMonthStart
}{\void}
165 Returns the date representing the first day of the month.
167 \membersection{wxDate::GetWeekOfMonth
}\label{wxdategetweekofmonth
}
169 \constfunc{int
}{GetWeekOfMonth
}{\void}
171 Returns the week of month (in the range
1 to
6).
173 \membersection{wxDate::GetWeekOfYear
}\label{wxdategetweekofyear
}
175 \constfunc{int
}{GetWeekOfYear
}{\void}
177 Returns the week of year (in the range
1 to
52).
179 \membersection{wxDate::GetYear
}\label{wxdategetyear
}
181 \constfunc{int
}{GetYear
}{\void}
183 Returns the year as an integer (such as `
1995').
185 \membersection{wxDate::GetYearEnd
}\label{wxdategetyearend
}
187 \constfunc{wxDate
}{GetYearEnd
}{\void}
189 Returns the date representing the last day of the year.
191 \membersection{wxDate::GetYearStart
}\label{wxdategetyearstart
}
193 \constfunc{wxDate
}{GetYearStart
}{\void}
195 Returns the date representing the first day of the year.
197 \membersection{wxDate::IsLeapYear
}\label{wxdateisleapyear
}
199 \constfunc{bool
}{IsLeapYear
}{\void}
201 Returns TRUE if the year of this date is a leap year.
203 \membersection{wxDate::Set
}\label{wxdateset
}
205 \func{wxDate\&
}{Set
}{\void}
207 Sets the date to current system date, returning a reference to `this'.
209 \func{wxDate\&
}{Set
}{\param{long
}{ julian
}}
211 Sets the date to the given Julian date, returning a reference to `this'.
213 \func{wxDate\&
}{Set
}{\param{int
}{ month
},
\param{int
}{ day
},
\param{int
}{ year
}}
215 Sets the date to the given date, returning a reference to `this'.
217 {\it month
} is a number from
1 to
12.
219 {\it day
} is a number from
1 to
31.
221 {\it year
} is a year, such as
1995,
2005.
223 \membersection{wxDate::SetFormat
}\label{wxdatesetformat
}
225 \func{void
}{SetFormat
}{\param{int
}{ format
}}
227 Sets the current format type.
229 \wxheading{Parameters
}
231 \docparam{format
}{-
1 or one of:
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.
}
242 \membersection{wxDate::SetOption
}\label{wxdatesetoption
}
244 \func{int
}{SetOption
}{\param{int
}{ option
},
\param{const bool
}{ enable=TRUE
}}
246 Enables or disables an option for formatting.
248 \wxheading{Parameters
}
250 \docparam{option
}{May be one of:
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.
}
258 \membersection{wxDate::operator wxString
}\label{wxdatewxstring
}
260 \func{}{operator wxString
}{\void}
262 Conversion operator, to convert wxDate to wxString by calling FormatDate.
264 \membersection{wxDate::operator $+$
}\label{wxdateplus
}
266 \func{wxDate
}{operator $+$
}{\param{long
}{ i
}}
268 \func{wxDate
}{operator $+$
}{\param{int
}{ i
}}
270 Adds an integer number of days to the date, returning a date.
272 \membersection{wxDate::operator $-$
}\label{wxdateminus
}
274 \func{wxDate
}{operator $-$
}{\param{long
}{ i
}}
276 \func{wxDate
}{operator $-$
}{\param{int
}{ i
}}
278 Subtracts an integer number of days from the date, returning a date.
280 \func{long
}{operator $-$
}{\param{const wxDate\&
}{ date
}}
282 Subtracts one date from another, return the number of intervening days.
284 \membersection{wxDate::operator $+=$
}\label{wxdateplusequals
}
286 \func{wxDate\&
}{operator $+=$
}{\param{long
}{ i
}}
288 Postfix operator: adds an integer number of days to the date, returning
289 a reference to `this' date.
291 \membersection{wxDate::operator $-=$
}\label{wxdateminusequals
}
293 \func{wxDate\&
}{operator $-=$
}{\param{long
}{ i
}}
295 Postfix operator: subtracts an integer number of days from the date, returning
296 a reference to `this' date.
298 \membersection{wxDate::operator $++$
}\label{wxdateplusplus
}
300 \func{wxDate\&
}{operator $++$
}{\void}
302 Increments the date (postfix or prefix).
304 \membersection{wxDate::operator $--$
}\label{wxdateminusminus
}
306 \func{wxDate\&
}{operator $--$
}{\void}
308 Decrements the date (postfix or prefix).
310 \membersection{wxDate::operator $<$
}\label{wxdatelessthan
}
312 \func{friend bool
}{operator $<$
}{\param{const wxDate\&
}{ date1
},
\param{const wxDate\&
}{ date2
}}
314 Function to compare two dates, returning TRUE if
{\it date1
} is earlier than
{\it date2
}.
316 \membersection{wxDate::operator $<=$
}\label{wxdatelessthaneq
}
318 \func{friend bool
}{operator $<=$
}{\param{const wxDate\&
}{ date1
},
\param{const wxDate\&
}{ date2
}}
320 Function to compare two dates, returning TRUE if
{\it date1
} is earlier than or equal to
{\it date2
}.
322 \membersection{wxDate::operator $>$
}\label{wxdategreaterthan
}
324 \func{friend bool
}{operator $>$
}{\param{const wxDate\&
}{ date1
},
\param{const wxDate\&
}{ date2
}}
326 Function to compare two dates, returning TRUE if
{\it date1
} is later than
{\it date2
}.
328 \membersection{wxDate::operator $>=$
}\label{wxdategreaterthaneq
}
330 \func{friend bool
}{operator $>=$
}{\param{const wxDate\&
}{ date1
},
\param{const wxDate\&
}{ date2
}}
332 Function to compare two dates, returning TRUE if
{\it date1
} is later than or equal to
{\it date2
}.
334 \membersection{wxDate::operator $==$
}\label{wxdateequals
}
336 \func{friend bool
}{operator $==$
}{\param{const wxDate\&
}{ date1
},
\param{const wxDate\&
}{ date2
}}
338 Function to compare two dates, returning TRUE if
{\it date1
} is equal to
{\it date2
}.
340 \membersection{wxDate::operator $!=$
}\label{wxdatenotequals
}
342 \func{friend bool
}{operator $!=$
}{\param{const wxDate\&
}{ date1
},
\param{const wxDate\&
}{ date2
}}
344 Function to compare two dates, returning TRUE if
{\it date1
} is not equal to
{\it date2
}.
346 \membersection{wxDate::operator
\cinsert}\label{wxdateinsert
}
348 \func{friend ostream\&
}{operator
\cinsert}{\param{ostream\&
}{ os
},
\param{const wxDate\&
}{ date
}}
350 Function to output a wxDate to an ostream.