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