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