]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/datetime.tex
wxRichTextAttr does not exist anymore - document instead wxTextAttr
[wxWidgets.git] / docs / latex / wx / datetime.tex
CommitLineData
d7da9756
VZ
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%% Name: datetime.tex
3%% Purpose: wxDateTime documentation
4%% Author: Vadim Zeitlin
5%% Modified by:
6%% Created: 07.03.00
7%% RCS-ID: $Id$
8%% Copyright: (c) Vadim Zeitlin
8795498c 9%% License: wxWindows license
d7da9756
VZ
10%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12\section{\class{wxDateTime}}\label{wxdatetime}
13
14wxDateTime class represents an absolute moment in the time.
15
16\wxheading{Types}
17
18The type {\tt wxDateTime\_t} is typedefed as {\tt unsigned short} and is used
19to contain the number of years, hours, minutes, seconds and milliseconds.
20
21\wxheading{Constants}
22
66f55ec6 23Global constant {\tt wxDefaultDateTime} and synonym for it {\tt wxInvalidDateTime} are defined. This constant will be different from any valid
d7da9756
VZ
24wxDateTime object.
25
26All the following constants are defined inside wxDateTime class (i.e., to refer to
27them you should prepend their names with {\tt wxDateTime::}).
28
fa482912 29Time zone symbolic names:
d7da9756
VZ
30
31\begin{verbatim}
32 enum TZ
33 {
34 // the time in the current time zone
35 Local,
36
37 // zones from GMT (= Greenwhich Mean Time): they're guaranteed to be
38 // consequent numbers, so writing something like `GMT0 + offset' is
39 // safe if abs(offset) <= 12
40
41 // underscore stands for minus
42 GMT_12, GMT_11, GMT_10, GMT_9, GMT_8, GMT_7,
43 GMT_6, GMT_5, GMT_4, GMT_3, GMT_2, GMT_1,
44 GMT0,
45 GMT1, GMT2, GMT3, GMT4, GMT5, GMT6,
34f90a1c 46 GMT7, GMT8, GMT9, GMT10, GMT11, GMT12, GMT13,
d7da9756
VZ
47 // Note that GMT12 and GMT_12 are not the same: there is a difference
48 // of exactly one day between them
49
50 // some symbolic names for TZ
51
52 // Europe
53 WET = GMT0, // Western Europe Time
54 WEST = GMT1, // Western Europe Summer Time
55 CET = GMT1, // Central Europe Time
56 CEST = GMT2, // Central Europe Summer Time
57 EET = GMT2, // Eastern Europe Time
58 EEST = GMT3, // Eastern Europe Summer Time
59 MSK = GMT3, // Moscow Time
60 MSD = GMT4, // Moscow Summer Time
61
62 // US and Canada
63 AST = GMT_4, // Atlantic Standard Time
64 ADT = GMT_3, // Atlantic Daylight Time
65 EST = GMT_5, // Eastern Standard Time
66 EDT = GMT_4, // Eastern Daylight Saving Time
67 CST = GMT_6, // Central Standard Time
68 CDT = GMT_5, // Central Daylight Saving Time
69 MST = GMT_7, // Mountain Standard Time
70 MDT = GMT_6, // Mountain Daylight Saving Time
71 PST = GMT_8, // Pacific Standard Time
72 PDT = GMT_7, // Pacific Daylight Saving Time
73 HST = GMT_10, // Hawaiian Standard Time
74 AKST = GMT_9, // Alaska Standard Time
75 AKDT = GMT_8, // Alaska Daylight Saving Time
76
77 // Australia
78
79 A_WST = GMT8, // Western Standard Time
34f90a1c 80 A_CST = GMT13 + 1, // Central Standard Time (+9.5)
d7da9756
VZ
81 A_EST = GMT10, // Eastern Standard Time
82 A_ESST = GMT11, // Eastern Summer Time
83
34f90a1c
VZ
84 // New Zealand
85 NZST = GMT12, // Standard Time
86 NZDT = GMT13, // Daylight Saving Time
87
d7da9756
VZ
88 // Universal Coordinated Time = the new and politically correct name
89 // for GMT
90 UTC = GMT0
91 };
92\end{verbatim}
93
94Month names: Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec and
f6bcfd97 95Inv\_Month for an invalid.month value are the values of {\tt wxDateTime::Month}
d7da9756
VZ
96enum.
97
f6bcfd97 98Likewise, Sun, Mon, Tue, Wed, Thu, Fri, Sat, and Inv\_WeekDay are the values in
d7da9756
VZ
99{\tt wxDateTime::WeekDay} enum.
100
101Finally, Inv\_Year is defined to be an invalid value for year parameter.
102
f6bcfd97 103\helpref{GetMonthName()}{wxdatetimegetmonthname} and
3103e8a9 104\helpref{GetWeekDayName}{wxdatetimegetweekdayname} functions use the following
f6bcfd97
BP
105flags:
106
107\begin{verbatim}
108 enum NameFlags
109 {
110 Name_Full = 0x01, // return full name
111 Name_Abbr = 0x02 // return abbreviated name
112 };
113\end{verbatim}
114
115Several functions accept an extra parameter specifying the calendar to use
116(although most of them only support now the Gregorian calendar). This
117parameters is one of the following values:
118
119\begin{verbatim}
120 enum Calendar
121 {
122 Gregorian, // calendar currently in use in Western countries
123 Julian // calendar in use since -45 until the 1582 (or later)
124 };
125\end{verbatim}
126
d3c7cfeb 127Date calculations often depend on the country and wxDateTime allows to set the
1aaf88d2 128country whose conventions should be used using
f6bcfd97
BP
129\helpref{SetCountry}{wxdatetimesetcountry}. It takes one of the following
130values as parameter:
131
132\begin{verbatim}
133 enum Country
134 {
135 Country_Unknown, // no special information for this country
136 Country_Default, // set the default country with SetCountry() method
137 // or use the default country with any other
138
139 Country_WesternEurope_Start,
140 Country_EEC = Country_WesternEurope_Start,
141 France,
142 Germany,
143 UK,
144 Country_WesternEurope_End = UK,
145
146 Russia,
147
148 USA
149 };
150\end{verbatim}
151
cdfb1ae1
VZ
152Different parts of the world use different conventions for the week start.
153In some countries, the week starts on Sunday, while in others -- on Monday.
f6bcfd97 154The ISO standard doesn't address this issue, so we support both conventions in
1aaf88d2 155the functions whose result depends on it (\helpref{GetWeekOfYear}{wxdatetimegetweekofyear} and
f6bcfd97
BP
156\helpref{GetWeekOfMonth}{wxdatetimegetweekofmonth}).
157
158The desired behvaiour may be specified by giving one of the following
159constants as argument to these functions:
160
161\begin{verbatim}
162 enum WeekFlags
163 {
164 Default_First, // Sunday_First for US, Monday_First for the rest
165 Monday_First, // week starts with a Monday
166 Sunday_First // week starts with a Sunday
167 };
168\end{verbatim}
169
d7da9756
VZ
170\wxheading{Derived from}
171
172No base class
173
174\wxheading{Include files}
175
176<wx/datetime.h>
177
a7af285d
VZ
178\wxheading{Library}
179
180\helpref{wxBase}{librarieslist}
181
d7da9756
VZ
182\wxheading{See also}
183
f6bcfd97 184\helpref{Date classes overview}{wxdatetimeoverview},\rtfsp
df05cdc5
VZ
185\helpref{wxTimeSpan}{wxtimespan},\rtfsp
186\helpref{wxDateSpan}{wxdatespan},\rtfsp
d7da9756
VZ
187\helpref{wxCalendarCtrl}{wxcalendarctrl}
188
189\latexignore{\rtfignore{\wxheading{Function groups}}}
190
4c27e2fa 191
b236c10f 192\membersection{Static functions}\label{datetimestaticfunctions}
d7da9756 193
fa482912 194For convenience, all static functions are collected here. These functions
d7da9756
VZ
195either set or return the static variables of wxDateSpan (the country), return
196the current moment, year, month or number of days in it, or do some general
197calendar-related actions.
198
f6bcfd97
BP
199Please note that although several function accept an extra {\it Calendar}
200parameter, it is currently ignored as only the Gregorian calendar is
201supported. Future versions will support other calendars.
202
1aaf88d2 203\pythonnote{These methods are standalone functions named
e7240349 204{\tt wxDateTime\_<StaticMethodName>} in wxPython.}
f6bcfd97 205
d7da9756
VZ
206\helpref{SetCountry}{wxdatetimesetcountry}\\
207\helpref{GetCountry}{wxdatetimegetcountry}\\
208\helpref{IsWestEuropeanCountry}{wxdatetimeiswesteuropeancountry}\\
209\helpref{GetCurrentYear}{wxdatetimegetcurrentyear}\\
210\helpref{ConvertYearToBC}{wxdatetimeconvertyeartobc}\\
211\helpref{GetCurrentMonth}{wxdatetimegetcurrentmonth}\\
212\helpref{IsLeapYear}{wxdatetimeisleapyear}\\
a333edbd 213\helpref{GetCentury}{wxdatetimegetcenturystatic}\\
d7da9756
VZ
214\helpref{GetNumberOfDays}{wxdatetimegetnumberofdays}\\
215\helpref{GetNumberOfDays}{wxdatetimegetnumberofdays}\\
216\helpref{GetMonthName}{wxdatetimegetmonthname}\\
217\helpref{GetWeekDayName}{wxdatetimegetweekdayname}\\
218\helpref{GetAmPmStrings}{wxdatetimegetampmstrings}\\
219\helpref{IsDSTApplicable}{wxdatetimeisdstapplicable}\\
220\helpref{GetBeginDST}{wxdatetimegetbegindst}\\
221\helpref{GetEndDST}{wxdatetimegetenddst}\\
222\helpref{Now}{wxdatetimenow}\\
f6bcfd97 223\helpref{UNow}{wxdatetimeunow}\\
d7da9756
VZ
224\helpref{Today}{wxdatetimetoday}
225
4c27e2fa 226
b236c10f 227\membersection{Constructors, assignment operators and setters}\label{datetimeconstructors}
d7da9756 228
f6bcfd97
BP
229Constructors and various {\tt Set()} methods are collected here. If you
230construct a date object from separate values for day, month and year, you
231should use \helpref{IsValid}{wxdatetimeisvalid} method to check that the
232values were correct as constructors can not return an error code.
233
234\helpref{wxDateTime()}{wxdatetimewxdatetimedef}\\
235\helpref{wxDateTime(time\_t)}{wxdatetimewxdatetimetimet}\\
236\helpref{wxDateTime(struct tm)}{wxdatetimewxdatetimetm}\\
237%\helpref{wxDateTime(struct Tm)}{wxdatetimewxdatetimetm} - Tm not documented yet\\
238\helpref{wxDateTime(double jdn)}{wxdatetimewxdatetimejdn}\\
239\helpref{wxDateTime(h, m, s, ms)}{wxdatetimewxdatetimetime}\\
240\helpref{wxDateTime(day, mon, year, h, m, s, ms)}{wxdatetimewxdatetimedate}\\
241\helpref{SetToCurrent}{wxdatetimesettocurrent}\\
242\helpref{Set(time\_t)}{wxdatetimesettimet}\\
243\helpref{Set(struct tm)}{wxdatetimesettm}\\
244%\helpref{Set(struct Tm)}{wxdatetimesettm} - Tm not documented yet\\
245\helpref{Set(double jdn)}{wxdatetimesetjdn}\\
246\helpref{Set(h, m, s, ms)}{wxdatetimesettime}\\
247\helpref{Set(day, mon, year, h, m, s, ms)}{wxdatetimesetdate}\\
2b5f62a0 248\helpref{SetFromDOS(unsigned long ddt)}{wxdatetimesetfromdos}\\
f6bcfd97
BP
249\helpref{ResetTime}{wxdatetimeresettime}\\
250\helpref{SetYear}{wxdatetimesetyear}\\
251\helpref{SetMonth}{wxdatetimesetmonth}\\
252\helpref{SetDay}{wxdatetimesetdate}\\
253\helpref{SetHour}{wxdatetimesethour}\\
254\helpref{SetMinute}{wxdatetimesetminute}\\
255\helpref{SetSecond}{wxdatetimesetsecond}\\
256\helpref{SetMillisecond}{wxdatetimesetmillisecond}\\
257\helpref{operator$=$(time\_t)}{wxdatetimeoperatoreqtimet}\\
d2c2afc9 258\helpref{operator$=$(struct tm)}{wxdatetimeoperatoreqtm}\rtfsp
f6bcfd97 259
4c27e2fa 260
b236c10f 261\membersection{Accessors}\label{datetimeaccessors}
d7da9756 262
f6bcfd97 263Here are the trivial accessors. Other functions, which might have to perform
1aaf88d2 264some more complicated calculations to find the answer are under the
b236c10f 265\helpref{Calendar calculations}{datetimecalculations} section.
f6bcfd97
BP
266
267\helpref{IsValid}{wxdatetimeisvalid}\\
268\helpref{GetTicks}{wxdatetimegetticks}\\
a333edbd 269\helpref{GetCentury}{wxdatetimegetcentury}\\
f6bcfd97
BP
270\helpref{GetYear}{wxdatetimegetyear}\\
271\helpref{GetMonth}{wxdatetimegetmonth}\\
272\helpref{GetDay}{wxdatetimegetday}\\
273\helpref{GetWeekDay}{wxdatetimegetweekday}\\
274\helpref{GetHour}{wxdatetimegethour}\\
cdfb1ae1 275\helpref{GetMinute}{wxdatetimegetminute}\\
f6bcfd97
BP
276\helpref{GetSecond}{wxdatetimegetsecond}\\
277\helpref{GetMillisecond}{wxdatetimegetmillisecond}\\
278\helpref{GetDayOfYear}{wxdatetimegetdayofyear}\\
279\helpref{GetWeekOfYear}{wxdatetimegetweekofyear}\\
280\helpref{GetWeekOfMonth}{wxdatetimegetweekofmonth}\\
281\helpref{GetYearDay}{wxdatetimegetyearday}\\
282\helpref{IsWorkDay}{wxdatetimeisworkday}\\
2b5f62a0
VZ
283\helpref{IsGregorianDate}{wxdatetimeisgregoriandate}\\
284\helpref{GetAsDOS}{wxdatetimegetasdos}
f6bcfd97 285
4c27e2fa 286
b236c10f 287\membersection{Date comparison}\label{datecomparison}
d7da9756 288
f6bcfd97
BP
289There are several function to allow date comparison. To supplement them, a few
290global operators $>$, $<$ etc taking wxDateTime are defined.
291
292\helpref{IsEqualTo}{wxdatetimeisequalto}\\
293\helpref{IsEarlierThan}{wxdatetimeisearlierthan}\\
294\helpref{IsLaterThan}{wxdatetimeislaterthan}\\
295\helpref{IsStrictlyBetween}{wxdatetimeisstrictlybetween}\\
296\helpref{IsBetween}{wxdatetimeisbetween}\\
297\helpref{IsSameDate}{wxdatetimeissamedate}\\
298\helpref{IsSameTime}{wxdatetimeissametime}\\
299\helpref{IsEqualUpTo}{wxdatetimeisequalupto}
300
4c27e2fa 301
b236c10f 302\membersection{Date arithmetics}\label{datearithmetics}
d7da9756 303
f6bcfd97
BP
304These functions carry out \helpref{arithmetics}{tdatearithm} on the wxDateTime
305objects. As explained in the overview, either wxTimeSpan or wxDateSpan may be
306added to wxDateTime, hence all functions are overloaded to accept both
307arguments.
308
309Also, both {\tt Add()} and {\tt Subtract()} have both const and non-const
feb571a4 310version. The first one returns a new object which represents the
f6bcfd97
BP
311sum/difference of the original one with the argument while the second form
312modifies the object to which it is applied. The operators $-=$ and $+=$ are
313defined to be equivalent to the second forms of these functions.
314
315\helpref{Add(wxTimeSpan)}{wxdatetimeaddts}\\
316\helpref{Add(wxDateSpan)}{wxdatetimeaddds}\\
317\helpref{Subtract(wxTimeSpan)}{wxdatetimesubtractts}\\
318\helpref{Subtract(wxDateSpan)}{wxdatetimesubtractds}\\
319\helpref{Subtract(wxDateTime)}{wxdatetimesubtractdt}\\
320\helpref{oparator$+=$(wxTimeSpan)}{wxdatetimeaddts}\\
321\helpref{oparator$+=$(wxDateSpan)}{wxdatetimeaddds}\\
322\helpref{oparator$-=$(wxTimeSpan)}{wxdatetimesubtractts}\\
323\helpref{oparator$-=$(wxDateSpan)}{wxdatetimesubtractds}
324
4c27e2fa 325
b236c10f 326\membersection{Parsing and formatting dates}\label{datetimeparsing}
d7da9756 327
feb571a4 328These functions convert wxDateTime objects to and from text. The
f6bcfd97 329conversions to text are mostly trivial: you can either do it using the default
1aaf88d2
WS
330date and time representations for the current locale (
331\helpref{FormatDate}{wxdatetimeformatdate} and
f6bcfd97 332\helpref{FormatTime}{wxdatetimeformattime}), using the international standard
1aaf88d2
WS
333representation defined by ISO 8601 (
334\helpref{FormatISODate}{wxdatetimeformatisodate} and
f6bcfd97
BP
335\helpref{FormatISOTime}{wxdatetimeformatisotime}) or by specifying any format
336at all and using \helpref{Format}{wxdatetimeformat} directly.
337
338The conversions from text are more interesting, as there are much more
1aaf88d2 339possibilities to care about. The simplest cases can be taken care of with
f6bcfd97
BP
340\helpref{ParseFormat}{wxdatetimeparseformat} which can parse any date in the
341given (rigid) format. \helpref{ParseRfc822Date}{wxdatetimeparserfc822date} is
cdfb1ae1 342another function for parsing dates in predefined format -- the one of RFC 822
f6bcfd97 343which (still...) defines the format of email messages on the Internet. This
1aaf88d2 344format can not be described with {\tt strptime(3)}-like format strings used by
f6bcfd97
BP
345\helpref{Format}{wxdatetimeformat}, hence the need for a separate function.
346
1aaf88d2
WS
347But the most interesting functions are
348\helpref{ParseTime}{wxdatetimeparsetime},
349\helpref{ParseDate}{wxdatetimeparsedate} and
cdfb1ae1
VZ
350\helpref{ParseDateTime}{wxdatetimeparsedatetime}. They try to parse the date
351ans time (or only one of them) in `free' format, i.e. allow them to be
352specified in any of possible ways. These functions will usually be used to
353parse the (interactive) user input which is not bound to be in any predefined
354format. As an example, \helpref{ParseDateTime}{wxdatetimeparsedatetime} can
1aaf88d2 355parse the strings such as {\tt "tomorrow"}, {\tt "March first"} and even
cdfb1ae1 356{\tt "next Sunday"}.
f6bcfd97
BP
357
358\helpref{ParseRfc822Date}{wxdatetimeparserfc822date}\\
359\helpref{ParseFormat}{wxdatetimeparseformat}\\
360\helpref{ParseDateTime}{wxdatetimeparsedatetime}\\
361\helpref{ParseDate}{wxdatetimeparsedate}\\
362\helpref{ParseTime}{wxdatetimeparsetime}\\
363\helpref{Format}{wxdatetimeformat}\\
364\helpref{FormatDate}{wxdatetimeformatdate}\\
365\helpref{FormatTime}{wxdatetimeformattime}\\
366\helpref{FormatISODate}{wxdatetimeformatisodate}\\
367\helpref{FormatISOTime}{wxdatetimeformatisotime}
368
4c27e2fa 369
b236c10f 370\membersection{Calendar calculations}\label{datetimecalculations}
f6bcfd97
BP
371
372The functions in this section perform the basic calendar calculations, mostly
373related to the week days. They allow to find the given week day in the
374week with given number (either in the month or in the year) and so on.
375
376All (non-const) functions in this section don't modify the time part of the
cdfb1ae1 377wxDateTime -- they only work with the date part of it.
f6bcfd97
BP
378
379\helpref{SetToWeekDayInSameWeek}{wxdatetimesettoweekdayinsameweek}\\
380\helpref{GetWeekDayInSameWeek}{wxdatetimegetweekdayinsameweek}\\
381\helpref{SetToNextWeekDay}{wxdatetimesettonextweekday}\\
382\helpref{GetNextWeekDay}{wxdatetimegetnextweekday}\\
383\helpref{SetToPrevWeekDay}{wxdatetimesettoprevweekday}\\
384\helpref{GetPrevWeekDay}{wxdatetimegetprevweekday}\\
385\helpref{SetToWeekDay}{wxdatetimesettoweekday}\\
386\helpref{GetWeekDay}{wxdatetimegetweekday2}\\
387\helpref{SetToLastWeekDay}{wxdatetimesettolastweekday}\\
388\helpref{GetLastWeekDay}{wxdatetimegetlastweekday}\\
4c27e2fa 389\helpref{SetToWeekOfYear}{wxdatetimesettoweekofyear}\\
f6bcfd97
BP
390\helpref{SetToLastMonthDay}{wxdatetimesettolastmonthday}\\
391\helpref{GetLastMonthDay}{wxdatetimegetlastmonthday}\\
392\helpref{SetToYearDay}{wxdatetimesettoyearday}\\
393\helpref{GetYearDay}{wxdatetimegetyearday}
d7da9756 394
4c27e2fa 395
b236c10f 396\membersection{Astronomical/historical functions}\label{astronomyhistoryfunctions}
d7da9756 397
f6bcfd97
BP
398Some degree of support for the date units used in astronomy and/or history is
399provided. You can construct a wxDateTime object from a
400\helpref{JDN}{wxdatetimesetjdn} and you may also get its JDN,
401\helpref{MJD}{wxdatetimegetmodifiedjuliandaynumber} or
402\helpref{Rata Die number}{wxdatetimegetratadie} from it.
403
404\helpref{wxDateTime(double jdn)}{wxdatetimewxdatetimejdn}\\
405\helpref{Set(double jdn)}{wxdatetimesetjdn}\\
406\helpref{GetJulianDayNumber}{wxdatetimegetjuliandaynumber}\\
407\helpref{GetJDN}{wxdatetimegetjdn}\\
408\helpref{GetModifiedJulianDayNumber}{wxdatetimegetmodifiedjuliandaynumber}\\
409\helpref{GetMJD}{wxdatetimegetmjd}\\
410\helpref{GetRataDie}{wxdatetimegetratadie}
411
4c27e2fa 412
b236c10f 413\membersection{Time zone and DST support}\label{datetimedstzone}
f6bcfd97
BP
414
415Please see the \helpref{time zone overview}{tdatetimezones} for more
3980000c 416information about time zones. Normally, these functions should be rarely used.
f6bcfd97 417
d26adb9d 418\helpref{FromTimezone}{wxdatetimefromtimezone}\\
f6bcfd97
BP
419\helpref{ToTimezone}{wxdatetimetotimezone}\\
420\helpref{MakeTimezone}{wxdatetimemaketimezone}\\
d26adb9d
VZ
421\helpref{MakeFromTimezone}{wxdatetimemakefromtimezone}\\
422\helpref{ToUTC}{wxdatetimetoutc}\\
423\helpref{MakeUTC}{wxdatetimemakeutc}\\
f6bcfd97
BP
424\helpref{GetBeginDST}{wxdatetimegetbegindst}\\
425\helpref{GetEndDST}{wxdatetimegetenddst}\\
426\helpref{IsDST}{wxdatetimeisdst}
d7da9756
VZ
427
428\helponly{\insertatlevel{2}{
429
430\wxheading{Members}
431
432}}
433
f6bcfd97
BP
434%%%%%%%%%%%%%%%%%%%%%%%%%%% static functions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
435
4c27e2fa 436
66f55ec6 437\membersection{wxDateTime::ConvertYearToBC}\label{wxdatetimeconvertyeartobc}
d7da9756 438
66f55ec6 439\func{static int}{ConvertYearToBC}{\param{int }{year}}
d7da9756
VZ
440
441Converts the year in absolute notation (i.e. a number which can be negative,
442positive or zero) to the year in BC/AD notation. For the positive years,
443nothing is done, but the year 0 is year 1 BC and so for other years there is a
444difference of 1.
445
446This function should be used like this:
447
448\begin{verbatim}
449 wxDateTime dt(...);
450 int y = dt.GetYear();
451 printf("The year is %d%s", wxDateTime::ConvertYearToBC(y), y > 0 ? "AD" : "BC");
452\end{verbatim}
453
4c27e2fa 454
66f55ec6 455\membersection{wxDateTime::GetAmPmStrings}\label{wxdatetimegetampmstrings}
d7da9756
VZ
456
457\func{static void}{GetAmPmStrings}{\param{wxString *}{am}, \param{wxString *}{pm}}
458
f6bcfd97
BP
459Returns the translations of the strings {\tt AM} and {\tt PM} used for time
460formatting for the current locale. Either of the pointers may be {\tt NULL} if
461the corresponding value is not needed.
462
4c27e2fa 463
66f55ec6 464\membersection{wxDateTime::GetBeginDST}\label{wxdatetimegetbegindst}
d7da9756
VZ
465
466\func{static wxDateTime}{GetBeginDST}{\param{int }{year = Inv\_Year}, \param{Country }{country = Country\_Default}}
467
f6bcfd97
BP
468Get the beginning of DST for the given country in the given year (current one
469by default). This function suffers from limitations described in
470\helpref{DST overview}{tdatedst}.
471
472\wxheading{See also}
473
474\helpref{GetEndDST}{wxdatetimegetenddst}
475
4c27e2fa 476
66f55ec6 477\membersection{wxDateTime::GetCountry}\label{wxdatetimegetcountry}
d7da9756
VZ
478
479\func{static Country}{GetCountry}{\void}
480
f6bcfd97
BP
481Returns the current default country. The default country is used for DST
482calculations, for example.
483
484\wxheading{See also}
485
486\helpref{SetCountry}{wxdatetimesetcountry}
487
4c27e2fa 488
66f55ec6 489\membersection{wxDateTime::GetCurrentYear}\label{wxdatetimegetcurrentyear}
d7da9756
VZ
490
491\func{static int}{GetCurrentYear}{\param{Calendar }{cal = Gregorian}}
492
f6bcfd97
BP
493Get the current year in given calendar (only Gregorian is currently supported).
494
4c27e2fa 495
66f55ec6 496\membersection{wxDateTime::GetCurrentMonth}\label{wxdatetimegetcurrentmonth}
d7da9756
VZ
497
498\func{static Month}{GetCurrentMonth}{\param{Calendar }{cal = Gregorian}}
499
f6bcfd97
BP
500Get the current month in given calendar (only Gregorian is currently supported).
501
4c27e2fa 502
a333edbd 503\membersection{wxDateTime::GetCentury}\label{wxdatetimegetcenturystatic}
d7da9756 504
a333edbd 505\func{static int}{GetCentury}{\param{int }{year}}
d7da9756 506
f6bcfd97
BP
507Get the current century, i.e. first two digits of the year, in given calendar
508(only Gregorian is currently supported).
509
4c27e2fa 510
66f55ec6 511\membersection{wxDateTime::GetEndDST}\label{wxdatetimegetenddst}
d7da9756
VZ
512
513\func{static wxDateTime}{GetEndDST}{\param{int }{year = Inv\_Year}, \param{Country }{country = Country\_Default}}
514
f6bcfd97
BP
515Returns the end of DST for the given country in the given year (current one by
516default).
517
518\wxheading{See also}
519
520\helpref{GetBeginDST}{wxdatetimegetbegindst}
521
4c27e2fa 522
66f55ec6 523\membersection{wxDateTime::GetMonthName}\label{wxdatetimegetmonthname}
d7da9756
VZ
524
525\func{static wxString}{GetMonthName}{\param{Month }{month}, \param{NameFlags }{flags = Name\_Full}}
526
f6bcfd97
BP
527Gets the full (default) or abbreviated (specify {\tt Name\_Abbr} name of the
528given month.
529
530\wxheading{See also}
531
532\helpref{GetWeekDayName}{wxdatetimegetweekdayname}
533
4c27e2fa 534
66f55ec6 535\membersection{wxDateTime::GetNumberOfDays}\label{wxdatetimegetnumberofdays}
d7da9756
VZ
536
537\func{static wxDateTime\_t}{GetNumberOfDays}{\param{int }{year}, \param{Calendar }{cal = Gregorian}}
538
d7da9756
VZ
539\func{static wxDateTime\_t}{GetNumberOfDays}{\param{Month }{month}, \param{int }{year = Inv\_Year}, \param{Calendar }{cal = Gregorian}}
540
f6bcfd97
BP
541Returns the number of days in the given year or in the given month of the
542year.
543
544The only supported value for {\it cal} parameter is currently {\tt Gregorian}.
545
546\pythonnote{These two methods are named {\tt GetNumberOfDaysInYear}
547and {\tt GetNumberOfDaysInMonth} in wxPython.}
548
4c27e2fa 549
1b4e1b3a
WS
550\membersection{wxDateTime::GetTimeNow}\label{wxdatetimegettimenow}
551
552\func{static time\_t}{GetTimeNow}{\void}
553
554Returns the current time.
555
556
557\membersection{wxDateTime::GetTmNow}\label{wxdatetimegettmnow}
558
a452689b
SN
559\func{static struct tm *}{GetTmNow}{\param{struct tm *}{tm}}
560
561Returns the current time broken down, uses the buffer whose adress is
562passed to the function via {\it tm} to store the result.
1b4e1b3a 563
a452689b
SN
564\membersection{wxDateTime::GetTmNow}
565
566\func{static struct tm *}{GetTmNow}{\void}
1b4e1b3a 567
a452689b
SN
568Returns the current time broken down. Note that this function returns a
569pointer to a static buffer that's reused by calls to this function and
570certain C library functions (e.g. localtime). If there is any chance your
571code might be used in a multi-threaded application, you really should use
572the flavour of function \helpref{wxDateTime::GetTmNow}{wxdatetimegettmnow}
573taking a parameter.
1b4e1b3a 574
66f55ec6 575\membersection{wxDateTime::GetWeekDayName}\label{wxdatetimegetweekdayname}
d7da9756
VZ
576
577\func{static wxString}{GetWeekDayName}{\param{WeekDay }{weekday}, \param{NameFlags }{flags = Name\_Full}}
578
f6bcfd97
BP
579Gets the full (default) or abbreviated (specify {\tt Name\_Abbr} name of the
580given week day.
581
582\wxheading{See also}
583
584\helpref{GetMonthName}{wxdatetimegetmonthname}
585
4c27e2fa 586
66f55ec6 587\membersection{wxDateTime::IsLeapYear}\label{wxdatetimeisleapyear}
d7da9756
VZ
588
589\func{static bool}{IsLeapYear}{\param{int }{year = Inv\_Year}, \param{Calendar }{cal = Gregorian}}
590
cc81d32f 591Returns {\tt true} if the {\it year} is a leap one in the specified calendar.
f6bcfd97
BP
592
593This functions supports Gregorian and Julian calendars.
594
4c27e2fa 595
66f55ec6 596\membersection{wxDateTime::IsWestEuropeanCountry}\label{wxdatetimeiswesteuropeancountry}
d7da9756
VZ
597
598\func{static bool}{IsWestEuropeanCountry}{\param{Country }{country = Country\_Default}}
599
cc81d32f 600This function returns {\tt true} if the specified (or default) country is one
f6bcfd97
BP
601of Western European ones. It is used internally by wxDateTime to determine the
602DST convention and date and time formatting rules.
603
4c27e2fa 604
66f55ec6 605\membersection{wxDateTime::IsDSTApplicable}\label{wxdatetimeisdstapplicable}
d7da9756
VZ
606
607\func{static bool}{IsDSTApplicable}{\param{int }{year = Inv\_Year}, \param{Country }{country = Country\_Default}}
608
cc81d32f 609Returns {\tt true} if DST was used n the given year (the current one by
f6bcfd97
BP
610default) in the given country.
611
4c27e2fa 612
66f55ec6 613\membersection{wxDateTime::Now}\label{wxdatetimenow}
d7da9756
VZ
614
615\func{static wxDateTime}{Now}{\void}
616
2edb0bde 617Returns the object corresponding to the current time.
f6bcfd97
BP
618
619Example:
620
621\begin{verbatim}
622 wxDateTime now = wxDateTime::Now();
623 printf("Current time in Paris:\t%s\n", now.Format("%c", wxDateTime::CET).c_str());
624\end{verbatim}
625
1aaf88d2 626Note that this function is accurate up to second:
f6bcfd97 627\helpref{wxDateTime::UNow}{wxdatetimeunow} should be used for better precision
2edb0bde 628(but it is less efficient and might not be available on all platforms).
f6bcfd97
BP
629
630\wxheading{See also}
631
632\helpref{Today}{wxdatetimetoday}
633
4c27e2fa 634
66f55ec6 635\membersection{wxDateTime::SetCountry}\label{wxdatetimesetcountry}
d7da9756
VZ
636
637\func{static void}{SetCountry}{\param{Country }{country}}
638
f6bcfd97
BP
639Sets the country to use by default. This setting influences the DST
640calculations, date formatting and other things.
641
642The possible values for {\it country} parameter are enumerated in
643\helpref{wxDateTime constants section}{wxdatetime}.
644
645\wxheading{See also}
646
647\helpref{GetCountry}{wxdatetimegetcountry}
648
4c27e2fa 649
66f55ec6 650\membersection{wxDateTime::Today}\label{wxdatetimetoday}
d7da9756
VZ
651
652\func{static wxDateTime}{Today}{\void}
653
f6bcfd97
BP
654Returns the object corresponding to the midnight of the current day (i.e. the
655same as \helpref{Now()}{wxdatetimenow}, but the time part is set to $0$).
656
657\wxheading{See also}
658
659\helpref{Now}{wxdatetimenow}
660
4c27e2fa 661
f6bcfd97
BP
662\membersection{wxDateTime::UNow}\label{wxdatetimeunow}
663
664\func{static wxDateTime}{UNow}{\void}
665
2edb0bde 666Returns the object corresponding to the current time including the
f6bcfd97
BP
667milliseconds if a function to get time with such precision is available on the
668current platform (supported under most Unices and Win32).
669
670\wxheading{See also}
671
672\helpref{Now}{wxdatetimenow}
673
674%%%%%%%%%%%%%%%%%%%%%%%%%%% constructors &c %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
675
4c27e2fa 676
f6bcfd97
BP
677\membersection{wxDateTime::wxDateTime}\label{wxdatetimewxdatetimedef}
678
679\func{}{wxDateTime}{\void}
680
681Default constructor. Use one of {\tt Set()} functions to initialize the object
682later.
683
4c27e2fa 684
f6bcfd97
BP
685\membersection{wxDateTime::wxDateTime}\label{wxdatetimewxdatetimetimet}
686
687\func{wxDateTime\&}{wxDateTime}{\param{time\_t }{timet}}
688
689Same as \helpref{Set}{wxdatetimewxdatetimetimet}.
690
691\pythonnote{This constructor is named {\tt wxDateTimeFromTimeT} in wxPython.}
692
4c27e2fa 693
f6bcfd97
BP
694\membersection{wxDateTime::wxDateTime}\label{wxdatetimewxdatetimetm}
695
696\func{wxDateTime\&}{wxDateTime}{\param{const struct tm\& }{tm}}
697
698Same as \helpref{Set}{wxdatetimewxdatetimetm}
699
700\pythonnote{Unsupported.}
701
4c27e2fa 702
f6bcfd97
BP
703\membersection{wxDateTime::wxDateTime}\label{wxdatetimewxdatetimejdn}
704
705\func{wxDateTime\&}{wxDateTime}{\param{double }{jdn}}
706
707Same as \helpref{Set}{wxdatetimewxdatetimejdn}
708
709\pythonnote{This constructor is named {\tt wxDateTimeFromJDN} in wxPython.}
710
4c27e2fa 711
f6bcfd97
BP
712\membersection{wxDateTime::wxDateTime}\label{wxdatetimewxdatetimetime}
713
714\func{wxDateTime\&}{wxDateTime}{\param{wxDateTime\_t }{hour}, \param{wxDateTime\_t }{minute = 0}, \param{wxDateTime\_t }{second = 0}, \param{wxDateTime\_t }{millisec = 0}}
715
716Same as \helpref{Set}{wxdatetimewxdatetimetime}
717
718\pythonnote{This constructor is named {\tt wxDateTimeFromHMS} in wxPython.}
719
4c27e2fa 720
f6bcfd97
BP
721\membersection{wxDateTime::wxDateTime}\label{wxdatetimewxdatetimedate}
722
1aaf88d2 723\func{wxDateTime\&}{wxDateTime}{\param{wxDateTime\_t }{day}, \param{Month }{month = Inv\_Month}, \param{int}{ Inv\_Year},
a9d171bd 724\param{wxDateTime\_t }{hour = 0}, \param{wxDateTime\_t }{minute = 0}, \param{wxDateTime\_t }{second = 0}, \param{wxDateTime\_t }{millisec = 0}}
f6bcfd97
BP
725
726Same as \helpref{Set}{wxdatetimesetdate}
727
728\pythonnote{This constructor is named {\tt wxDateTimeFromDMY} in wxPython.}
729
4c27e2fa 730
f6bcfd97
BP
731\membersection{wxDateTime::SetToCurrent}\label{wxdatetimesettocurrent}
732
7af3ca16 733\func{wxDateTime\&}{SetToCurrent}{\void}
f6bcfd97
BP
734
735Sets the date and time of to the current values. Same as assigning the result
736of \helpref{Now()}{wxdatetimenow} to this object.
737
4c27e2fa 738
f6bcfd97
BP
739\membersection{wxDateTime::Set}\label{wxdatetimesettimet}
740
741\func{wxDateTime\&}{Set}{\param{time\_t }{timet}}
742
743Constructs the object from {\it timet} value holding the number of seconds
744since Jan 1, 1970.
745
746\pythonnote{This method is named {\tt SetTimeT} in wxPython.}
747
4c27e2fa 748
f6bcfd97
BP
749\membersection{wxDateTime::Set}\label{wxdatetimesettm}
750
751\func{wxDateTime\&}{Set}{\param{const struct tm\& }{tm}}
752
2edb0bde 753Sets the date and time from the broken down representation in the standard
f6bcfd97
BP
754{\tt tm} structure.
755
756\pythonnote{Unsupported.}
757
4c27e2fa 758
f6bcfd97
BP
759\membersection{wxDateTime::Set}\label{wxdatetimesetjdn}
760
761\func{wxDateTime\&}{Set}{\param{double }{jdn}}
762
763Sets the date from the so-called {\it Julian Day Number}.
764
765By definition, the Julian Day Number, usually abbreviated as JDN, of a
766particular instant is the fractional number of days since 12 hours Universal
2edb0bde 767Coordinated Time (Greenwich mean noon) on January 1 of the year -4712 in the
f6bcfd97
BP
768Julian proleptic calendar.
769
770\pythonnote{This method is named {\tt SetJDN} in wxPython.}
771
4c27e2fa 772
f6bcfd97
BP
773\membersection{wxDateTime::Set}\label{wxdatetimesettime}
774
775\func{wxDateTime\&}{Set}{\param{wxDateTime\_t }{hour}, \param{wxDateTime\_t }{minute = 0}, \param{wxDateTime\_t }{second = 0}, \param{wxDateTime\_t }{millisec = 0}}
776
777Sets the date to be equal to \helpref{Today}{wxdatetimetoday} and the time
778from supplied parameters.
779
780\pythonnote{This method is named {\tt SetHMS} in wxPython.}
781
4c27e2fa 782
f6bcfd97
BP
783\membersection{wxDateTime::Set}\label{wxdatetimesetdate}
784
fafcf127 785\func{wxDateTime\&}{Set}{\param{wxDateTime\_t }{day}, \param{Month }{month = Inv\_Month}, \param{int }{year = Inv\_Year}, \param{wxDateTime\_t }{hour = 0}, \param{wxDateTime\_t }{minute = 0}, \param{wxDateTime\_t }{second = 0}, \param{wxDateTime\_t }{millisec = 0}}
f6bcfd97
BP
786
787Sets the date and time from the parameters.
788
4c27e2fa 789
f6bcfd97
BP
790\membersection{wxDateTime::ResetTime}\label{wxdatetimeresettime}
791
792\func{wxDateTime\&}{ResetTime}{\void}
793
794Reset time to midnight (00:00:00) without changing the date.
795
4c27e2fa 796
f6bcfd97
BP
797\membersection{wxDateTime::SetYear}\label{wxdatetimesetyear}
798
799\func{wxDateTime\&}{SetYear}{\param{int }{year}}
800
801Sets the year without changing other date components.
802
4c27e2fa 803
f6bcfd97
BP
804\membersection{wxDateTime::SetMonth}\label{wxdatetimesetmonth}
805
806\func{wxDateTime\&}{SetMonth}{\param{Month }{month}}
807
808Sets the month without changing other date components.
809
4c27e2fa 810
f6bcfd97
BP
811\membersection{wxDateTime::SetDay}\label{wxdatetimesetday}
812
813\func{wxDateTime\&}{SetDay}{\param{wxDateTime\_t }{day}}
814
815Sets the day without changing other date components.
816
4c27e2fa 817
f6bcfd97
BP
818\membersection{wxDateTime::SetHour}\label{wxdatetimesethour}
819
820\func{wxDateTime\&}{SetHour}{\param{wxDateTime\_t }{hour}}
821
822Sets the hour without changing other date components.
823
4c27e2fa 824
f6bcfd97
BP
825\membersection{wxDateTime::SetMinute}\label{wxdatetimesetminute}
826
827\func{wxDateTime\&}{SetMinute}{\param{wxDateTime\_t }{minute}}
828
829Sets the minute without changing other date components.
830
4c27e2fa 831
f6bcfd97
BP
832\membersection{wxDateTime::SetSecond}\label{wxdatetimesetsecond}
833
834\func{wxDateTime\&}{SetSecond}{\param{wxDateTime\_t }{second}}
835
836Sets the second without changing other date components.
837
4c27e2fa 838
f6bcfd97
BP
839\membersection{wxDateTime::SetMillisecond}\label{wxdatetimesetmillisecond}
840
841\func{wxDateTime\&}{SetMillisecond}{\param{wxDateTime\_t }{millisecond}}
842
843Sets the millisecond without changing other date components.
844
4c27e2fa 845
f6bcfd97
BP
846\membersection{wxDateTime::operator$=$}\label{wxdatetimeoperatoreqtimet}
847
848\func{wxDateTime\&}{operator}{\param{time\_t }{timet}}
849
850Same as \helpref{Set}{wxdatetimesettimet}.
851
4c27e2fa 852
f6bcfd97
BP
853\membersection{wxDateTime::operator$=$}\label{wxdatetimeoperatoreqtm}
854
855\func{wxDateTime\&}{operator}{\param{const struct tm\& }{tm}}
856
857Same as \helpref{Set}{wxdatetimesettm}.
858
859%%%%%%%%%%%%%%%%%%%%%%%%%%% accessors %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
860
4c27e2fa 861
f6bcfd97
BP
862\membersection{wxDateTime::IsValid}\label{wxdatetimeisvalid}
863
864\constfunc{bool}{IsValid}{\void}
865
cc81d32f 866Returns {\tt true} if the object represents a valid time moment.
f6bcfd97 867
4c27e2fa 868
fb96cf85
VZ
869\membersection{wxDateTime::GetDateOnly}\label{wxdatetimegetdateonly}
870
871\constfunc{wxDateTime}{GetDateOnly}{\void}
872
873Returns the object having the same date component as this one but time of
87400:00:00.
875
876\newsince{2.8.2}
877
878\wxheading{See also}
879
880\helpref{ResetTime}{wxdatetimeresettime}
881
882
f6bcfd97
BP
883\membersection{wxDateTime::GetTm}\label{wxdatetimegettm}
884
885\constfunc{Tm}{GetTm}{\param{const TimeZone\& }{tz = Local}}
886
887Returns broken down representation of the date and time.
888
4c27e2fa 889
f6bcfd97
BP
890\membersection{wxDateTime::GetTicks}\label{wxdatetimegetticks}
891
892\constfunc{time\_t}{GetTicks}{\void}
893
894Returns the number of seconds since Jan 1, 1970. An assert failure will occur
895if the date is not in the range covered by {\tt time\_t} type.
896
4c27e2fa 897
a333edbd
VZ
898\membersection{wxDateTime::GetCentury}\label{wxdatetimegetcentury}
899
900\constfunc{int}{GetCentury}{\param{const TimeZone\& }{tz = Local}}
901
902Returns the century of this date.
903
904
f6bcfd97
BP
905\membersection{wxDateTime::GetYear}\label{wxdatetimegetyear}
906
907\constfunc{int}{GetYear}{\param{const TimeZone\& }{tz = Local}}
908
909Returns the year in the given timezone (local one by default).
910
4c27e2fa 911
f6bcfd97
BP
912\membersection{wxDateTime::GetMonth}\label{wxdatetimegetmonth}
913
914\constfunc{Month}{GetMonth}{\param{const TimeZone\& }{tz = Local}}
915
916Returns the month in the given timezone (local one by default).
917
4c27e2fa 918
f6bcfd97
BP
919\membersection{wxDateTime::GetDay}\label{wxdatetimegetday}
920
921\constfunc{wxDateTime\_t}{GetDay}{\param{const TimeZone\& }{tz = Local}}
922
923Returns the day in the given timezone (local one by default).
924
4c27e2fa 925
f6bcfd97
BP
926\membersection{wxDateTime::GetWeekDay}\label{wxdatetimegetweekday}
927
928\constfunc{WeekDay}{GetWeekDay}{\param{const TimeZone\& }{tz = Local}}
929
930Returns the week day in the given timezone (local one by default).
931
4c27e2fa 932
f6bcfd97
BP
933\membersection{wxDateTime::GetHour}\label{wxdatetimegethour}
934
935\constfunc{wxDateTime\_t}{GetHour}{\param{const TimeZone\& }{tz = Local}}
936
937Returns the hour in the given timezone (local one by default).
938
4c27e2fa 939
f6bcfd97
BP
940\membersection{wxDateTime::GetMinute}\label{wxdatetimegetminute}
941
942\constfunc{wxDateTime\_t}{GetMinute}{\param{const TimeZone\& }{tz = Local}}
943
944Returns the minute in the given timezone (local one by default).
945
4c27e2fa 946
f6bcfd97
BP
947\membersection{wxDateTime::GetSecond}\label{wxdatetimegetsecond}
948
949\constfunc{wxDateTime\_t}{GetSecond}{\param{const TimeZone\& }{tz = Local}}
950
951Returns the seconds in the given timezone (local one by default).
952
4c27e2fa 953
f6bcfd97
BP
954\membersection{wxDateTime::GetMillisecond}\label{wxdatetimegetmillisecond}
955
956\constfunc{wxDateTime\_t}{GetMillisecond}{\param{const TimeZone\& }{tz = Local}}
957
958Returns the milliseconds in the given timezone (local one by default).
959
4c27e2fa 960
f6bcfd97
BP
961\membersection{wxDateTime::GetDayOfYear}\label{wxdatetimegetdayofyear}
962
963\constfunc{wxDateTime\_t}{GetDayOfYear}{\param{const TimeZone\& }{tz = Local}}
964
965Returns the day of the year (in $1\ldots366$ range) in the given timezone
966(local one by default).
967
4c27e2fa 968
f6bcfd97
BP
969\membersection{wxDateTime::GetWeekOfYear}\label{wxdatetimegetweekofyear}
970
971\constfunc{wxDateTime\_t}{GetWeekOfYear}{\param{WeekFlags }{flags = Monday\_First}, \param{const TimeZone\& }{tz = Local}}
972
973Returns the number of the week of the year this date is in. The first week of
4c27e2fa
VZ
974the year is, according to international standards, the one containing Jan 4 or,
975equivalently, the first week which has Thursday in this year. Both of these
976definitions are the same as saying that the first week of the year must contain
977more than half of its days in this year. Accordingly, the week number will
154b6b0f 978always be in $1\ldots53$ range ($52$ for non-leap years).
f6bcfd97
BP
979
980The function depends on the \helpref{week start}{wxdatetime} convention
1aaf88d2 981specified by the {\it flags} argument but its results for
4c27e2fa
VZ
982\texttt{Sunday\_First} are not well-defined as the ISO definition quoted above
983applies to the weeks starting on Monday only.
984
f6bcfd97
BP
985
986\membersection{wxDateTime::GetWeekOfMonth}\label{wxdatetimegetweekofmonth}
987
988\constfunc{wxDateTime\_t}{GetWeekOfMonth}{\param{WeekFlags }{flags = Monday\_First}, \param{const TimeZone\& }{tz = Local}}
989
990Returns the ordinal number of the week in the month (in $1\ldots5$ range).
991
992As \helpref{GetWeekOfYear}{wxdatetimegetweekofyear}, this function supports
993both conventions for the week start. See the description of these
994\helpref{week start}{wxdatetime} conventions.
995
4c27e2fa 996
f6bcfd97
BP
997\membersection{wxDateTime::IsWorkDay}\label{wxdatetimeisworkday}
998
999\constfunc{bool}{IsWorkDay}{\param{Country }{country = Country\_Default}}
1000
cc81d32f 1001Returns {\tt true} is this day is not a holiday in the given country.
f6bcfd97 1002
4c27e2fa 1003
f6bcfd97
BP
1004\membersection{wxDateTime::IsGregorianDate}\label{wxdatetimeisgregoriandate}
1005
1006\constfunc{bool}{IsGregorianDate}{\param{GregorianAdoption }{country = Gr\_Standard}}
1007
f70c0443 1008Returns {\tt true} if the given date is later than the date of adoption of the
f6bcfd97
BP
1009Gregorian calendar in the given country (and hence the Gregorian calendar
1010calculations make sense for it).
1011
2b5f62a0
VZ
1012%%%%%%%%%%%%%%%%%%%%%% dos date and time format %%%%%%%%%%%%%%%%%%%%%%%
1013
4c27e2fa 1014
2b5f62a0
VZ
1015\membersection{wxDateTime::SetFromDOS}\label{wxdatetimesetfromdos}
1016
1017\func{wxDateTime\&}{Set}{\param{unsigned long }{ddt}}
1018
1aaf88d2
WS
1019Sets the date from the date and time in
1020\urlref{DOS}{http://developer.novell.com/ndk/doc/smscomp/index.html?page=/ndk/doc/smscomp/sms\_docs/data/hc2vlu5i.html}
2b5f62a0
VZ
1021format.
1022
4c27e2fa 1023
2b5f62a0
VZ
1024\membersection{wxDateTime::GetAsDOS}\label{wxdatetimegetasdos}
1025
1026\constfunc{unsigned long}{GetAsDOS}{\void}
1027
1aaf88d2
WS
1028Returns the date and time in
1029\urlref{DOS}{http://developer.novell.com/ndk/doc/smscomp/index.html?page=/ndk/doc/smscomp/sms\_docs/data/hc2vlu5i.html}
2b5f62a0
VZ
1030format.
1031
f6bcfd97
BP
1032%%%%%%%%%%%%%%%%%%%%%%%%%%% comparison %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1033
4c27e2fa 1034
f6bcfd97
BP
1035\membersection{wxDateTime::IsEqualTo}\label{wxdatetimeisequalto}
1036
7af3ca16 1037\constfunc{bool}{IsEqualTo}{\param{const wxDateTime\& }{datetime}}
f6bcfd97 1038
cc81d32f 1039Returns {\tt true} if the two dates are strictly identical.
f6bcfd97 1040
4c27e2fa 1041
f6bcfd97
BP
1042\membersection{wxDateTime::IsEarlierThan}\label{wxdatetimeisearlierthan}
1043
7af3ca16 1044\constfunc{bool}{IsEarlierThan}{\param{const wxDateTime\& }{datetime}}
f6bcfd97 1045
cc81d32f 1046Returns {\tt true} if this date precedes the given one.
f6bcfd97 1047
4c27e2fa 1048
f6bcfd97
BP
1049\membersection{wxDateTime::IsLaterThan}\label{wxdatetimeislaterthan}
1050
7af3ca16 1051\constfunc{bool}{IsLaterThan}{\param{const wxDateTime\& }{datetime}}
f6bcfd97 1052
cc81d32f 1053Returns {\tt true} if this date is later than the given one.
f6bcfd97 1054
4c27e2fa 1055
f6bcfd97
BP
1056\membersection{wxDateTime::IsStrictlyBetween}\label{wxdatetimeisstrictlybetween}
1057
7af3ca16 1058\constfunc{bool}{IsStrictlyBetween}{\param{const wxDateTime\& }{t1}, \param{const wxDateTime\& }{t2}}
f6bcfd97 1059
cc81d32f 1060Returns {\tt true} if this date lies strictly between the two others,
f6bcfd97
BP
1061
1062\wxheading{See also}
1063
1064\helpref{IsBetween}{wxdatetimeisbetween}
1065
4c27e2fa 1066
f6bcfd97
BP
1067\membersection{wxDateTime::IsBetween}\label{wxdatetimeisbetween}
1068
7af3ca16 1069\constfunc{bool}{IsBetween}{\param{const wxDateTime\& }{t1}, \param{const wxDateTime\& }{t2}}
f6bcfd97 1070
cc81d32f
VS
1071Returns {\tt true} if \helpref{IsStrictlyBetween}{wxdatetimeisstrictlybetween}
1072is {\tt true} or if the date is equal to one of the limit values.
f6bcfd97
BP
1073
1074\wxheading{See also}
1075
1076\helpref{IsStrictlyBetween}{wxdatetimeisstrictlybetween}
1077
4c27e2fa 1078
f6bcfd97
BP
1079\membersection{wxDateTime::IsSameDate}\label{wxdatetimeissamedate}
1080
7af3ca16 1081\constfunc{bool}{IsSameDate}{\param{const wxDateTime\& }{dt}}
f6bcfd97 1082
cc81d32f 1083Returns {\tt true} if the date is the same without comparing the time parts.
f6bcfd97 1084
4c27e2fa 1085
f6bcfd97
BP
1086\membersection{wxDateTime::IsSameTime}\label{wxdatetimeissametime}
1087
7af3ca16 1088\constfunc{bool}{IsSameTime}{\param{const wxDateTime\& }{dt}}
f6bcfd97 1089
cc81d32f 1090Returns {\tt true} if the time is the same (although dates may differ).
f6bcfd97 1091
4c27e2fa 1092
f6bcfd97
BP
1093\membersection{wxDateTime::IsEqualUpTo}\label{wxdatetimeisequalupto}
1094
1095\constfunc{bool}{IsEqualUpTo}{\param{const wxDateTime\& }{dt}, \param{const wxTimeSpan\& }{ts}}
1096
cc81d32f 1097Returns {\tt true} if the date is equal to another one up to the given time
f6bcfd97
BP
1098interval, i.e. if the absolute difference between the two dates is less than
1099this interval.
1100
1101%%%%%%%%%%%%%%%%%%%%%%%%%%% arithmetics %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1102
4c27e2fa 1103
f6bcfd97
BP
1104\membersection{wxDateTime::Add}\label{wxdatetimeaddts}
1105
1106\constfunc{wxDateTime}{Add}{\param{const wxTimeSpan\& }{diff}}
1107
1108\func{wxDateTime\&}{Add}{\param{const wxTimeSpan\& }{diff}}
1109
1110\func{wxDateTime\&}{operator$+=$}{\param{const wxTimeSpan\& }{diff}}
1111
1112Adds the given time span to this object.
1113
1114\pythonnote{This method is named {\tt AddTS} in wxPython.}
1115
f6bcfd97 1116
4c27e2fa 1117
f6bcfd97
BP
1118\membersection{wxDateTime::Add}\label{wxdatetimeaddds}
1119
1120\constfunc{wxDateTime}{Add}{\param{const wxDateSpan\& }{diff}}
1121
1122\func{wxDateTime\&}{Add}{\param{const wxDateSpan\& }{diff}}
1123
1124\func{wxDateTime\&}{operator$+=$}{\param{const wxDateSpan\& }{diff}}
1125
1126Adds the given date span to this object.
1127
1128\pythonnote{This method is named {\tt AddDS} in wxPython.}
1129
673e6120 1130
4c27e2fa 1131
673e6120
VZ
1132\membersection{wxDateTime::Subtract}\label{wxdatetimesubtractts}
1133
1134\constfunc{wxDateTime}{Subtract}{\param{const wxTimeSpan\& }{diff}}
1135
1136\func{wxDateTime\&}{Subtract}{\param{const wxTimeSpan\& }{diff}}
1137
1138\func{wxDateTime\&}{operator$-=$}{\param{const wxTimeSpan\& }{diff}}
1139
1140Subtracts the given time span from this object.
1141
1142\pythonnote{This method is named {\tt SubtractTS} in wxPython.}
1143
1144
4c27e2fa 1145
f6bcfd97
BP
1146\membersection{wxDateTime::Subtract}\label{wxdatetimesubtractds}
1147
1148\constfunc{wxDateTime}{Subtract}{\param{const wxDateSpan\& }{diff}}
1149
1150\func{wxDateTime\&}{Subtract}{\param{const wxDateSpan\& }{diff}}
1151
1152\func{wxDateTime\&}{operator$-=$}{\param{const wxDateSpan\& }{diff}}
1153
1154Subtracts the given date span from this object.
1155
1156\pythonnote{This method is named {\tt SubtractDS} in wxPython.}
1157
673e6120 1158
4c27e2fa 1159
f6bcfd97
BP
1160\membersection{wxDateTime::Subtract}\label{wxdatetimesubtractdt}
1161
1162\constfunc{wxTimeSpan}{Subtract}{\param{const wxDateTime\& }{dt}}
1163
1164Subtracts another date from this one and returns the difference between them
1165as wxTimeSpan.
1166
1167%%%%%%%%%%%%%%%%%%%%%%%%%%% parsing/formatting %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1168
4c27e2fa 1169
f6bcfd97
BP
1170\membersection{wxDateTime::ParseRfc822Date}\label{wxdatetimeparserfc822date}
1171
1172\func{const wxChar *}{ParseRfc822Date}{\param{const wxChar* }{date}}
1173
1174Parses the string {\it date} looking for a date formatted according to the RFC
1175822 in it. The exact description of this format may, of course, be found in
1176the RFC (section $5$), but, briefly, this is the format used in the headers of
1177Internet email messages and one of the most common strings expressing date in
1178this format may be something like {\tt "Sat, 18 Dec 1999 00:48:30 +0100"}.
1179
1180Returns {\tt NULL} if the conversion failed, otherwise return the pointer to
1181the character immediately following the part of the string which could be
1182parsed. If the entire string contains only the date in RFC 822 format,
1183the returned pointer will be pointing to a {\tt NUL} character.
1184
2edb0bde 1185This function is intentionally strict, it will return an error for any string
f6bcfd97
BP
1186which is not RFC 822 compliant. If you need to parse date formatted in more
1187free ways, you should use \helpref{ParseDateTime}{wxdatetimeparsedatetime} or
1188\helpref{ParseDate}{wxdatetimeparsedate} instead.
1189
4c27e2fa 1190
f6bcfd97
BP
1191\membersection{wxDateTime::ParseFormat}\label{wxdatetimeparseformat}
1192
1aaf88d2 1193\func{const wxChar *}{ParseFormat}{\param{const wxChar *}{date}, \param{const wxChar *}{format = wxDefaultDateTimeFormat}, \param{const wxDateTime\& }{dateDef = wxDefaultDateTime}}
f6bcfd97
BP
1194
1195This function parses the string {\it date} according to the given
1196{\it format}. The system {\tt strptime(3)} function is used whenever available,
654a0fa9
JS
1197but even if it is not, this function is still implemented, although support
1198for locale-dependent format specifiers such as {\tt "\%c"}, {\tt "\%x"} or {\tt "\%X"} may
1199not be perfect and GNU extensions such as {\tt "\%z"} and {\tt "\%Z"} are
1200not implemented. This function does handle the month and weekday
1201names in the current locale on all platforms, however.
f6bcfd97 1202
654a0fa9
JS
1203Please see the description of the ANSI C function {\tt strftime(3)} for the syntax
1204of the format string.
f6bcfd97
BP
1205
1206The {\it dateDef} parameter is used to fill in the fields which could not be
654a0fa9
JS
1207determined from the format string. For example, if the format is {\tt "\%d"} (the
1208ay of the month), the month and the year are taken from {\it dateDef}. If
1209it is not specified, \helpref{Today}{wxdatetimetoday} is used as the
f6bcfd97
BP
1210default date.
1211
1212Returns {\tt NULL} if the conversion failed, otherwise return the pointer to
1213the character which stopped the scan.
1214
4c27e2fa 1215
f6bcfd97
BP
1216\membersection{wxDateTime::ParseDateTime}\label{wxdatetimeparsedatetime}
1217
1218\func{const wxChar *}{ParseDateTime}{\param{const wxChar *}{datetime}}
1219
1220Parses the string {\it datetime} containing the date and time in free format.
1221This function tries as hard as it can to interpret the given string as date
1222and time. Unlike \helpref{ParseRfc822Date}{wxdatetimeparserfc822date}, it
1223will accept anything that may be accepted and will only reject strings which
1224can not be parsed in any way at all.
1225
1226Returns {\tt NULL} if the conversion failed, otherwise return the pointer to
42413abf 1227the character which stopped the scan.
f6bcfd97 1228
4c27e2fa 1229
f6bcfd97
BP
1230\membersection{wxDateTime::ParseDate}\label{wxdatetimeparsedate}
1231
1232\func{const wxChar *}{ParseDate}{\param{const wxChar *}{date}}
1233
1234This function is like \helpref{ParseDateTime}{wxdatetimeparsedatetime}, but it
1aaf88d2 1235only allows the date to be specified. It is thus less flexible then
f6bcfd97
BP
1236\helpref{ParseDateTime}{wxdatetimeparsedatetime}, but also has less chances to
1237misinterpret the user input.
1238
1239Returns {\tt NULL} if the conversion failed, otherwise return the pointer to
1240the character which stopped the scan.
1241
4c27e2fa 1242
f6bcfd97
BP
1243\membersection{wxDateTime::ParseTime}\label{wxdatetimeparsetime}
1244
1245\func{const wxChar *}{ParseTime}{\param{const wxChar *}{time}}
1246
1247This functions is like \helpref{ParseDateTime}{wxdatetimeparsedatetime}, but
1248only allows the time to be specified in the input string.
1249
1250Returns {\tt NULL} if the conversion failed, otherwise return the pointer to
1251the character which stopped the scan.
1252
4c27e2fa 1253
f6bcfd97
BP
1254\membersection{wxDateTime::Format}\label{wxdatetimeformat}
1255
1aaf88d2 1256\constfunc{wxString }{Format}{\param{const wxChar *}{format = wxDefaultDateTimeFormat}, \param{const TimeZone\& }{tz = Local}}
f6bcfd97
BP
1257
1258This function does the same as the standard ANSI C {\tt strftime(3)} function.
1259Please see its description for the meaning of {\it format} parameter.
1260
fc2171bd 1261It also accepts a few wxWidgets-specific extensions: you can optionally specify
f6bcfd97 1262the width of the field to follow using {\tt printf(3)}-like syntax and the
2edb0bde 1263format specification {\tt \%l} can be used to get the number of milliseconds.
f6bcfd97
BP
1264
1265\wxheading{See also}
1266
1267\helpref{ParseFormat}{wxdatetimeparseformat}
1268
4c27e2fa 1269
f6bcfd97
BP
1270\membersection{wxDateTime::FormatDate}\label{wxdatetimeformatdate}
1271
1272\constfunc{wxString }{FormatDate}{\void}
1273
1274Identical to calling \helpref{Format()}{wxdatetimeformat} with {\tt "\%x"}
1275argument (which means `preferred date representation for the current locale').
1276
4c27e2fa 1277
f6bcfd97
BP
1278\membersection{wxDateTime::FormatTime}\label{wxdatetimeformattime}
1279
1280\constfunc{wxString }{FormatTime}{\void}
1281
1282Identical to calling \helpref{Format()}{wxdatetimeformat} with {\tt "\%X"}
1283argument (which means `preferred time representation for the current locale').
1284
4c27e2fa 1285
f6bcfd97
BP
1286\membersection{wxDateTime::FormatISODate}\label{wxdatetimeformatisodate}
1287
1288\constfunc{wxString }{FormatISODate}{\void}
1289
1290This function returns the date representation in the ISO 8601 format
1291(YYYY-MM-DD).
1292
4c27e2fa 1293
f6bcfd97
BP
1294\membersection{wxDateTime::FormatISOTime}\label{wxdatetimeformatisotime}
1295
1296\constfunc{wxString }{FormatISOTime}{\void}
1297
1298This function returns the time representation in the ISO 8601 format
1299(HH:MM:SS).
1300
1301%%%%%%%%%%%%%%%%%%%%%%%%%%% calendar calculations %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1302
4c27e2fa 1303
f6bcfd97
BP
1304\membersection{wxDateTime::SetToWeekDayInSameWeek}\label{wxdatetimesettoweekdayinsameweek}
1305
2b5f62a0 1306\func{wxDateTime\&}{SetToWeekDayInSameWeek}{\param{WeekDay }{weekday}, \param{WeekFlags}{flags = {\tt Monday\_First}}}
f6bcfd97
BP
1307
1308Adjusts the date so that it will still lie in the same week as before, but its
1309week day will be the given one.
1310
1311Returns the reference to the modified object itself.
1312
4c27e2fa 1313
f6bcfd97
BP
1314\membersection{wxDateTime::GetWeekDayInSameWeek}\label{wxdatetimegetweekdayinsameweek}
1315
2b5f62a0 1316\constfunc{wxDateTime}{GetWeekDayInSameWeek}{\param{WeekDay }{weekday}, \param{WeekFlags}{flags = {\tt Monday\_First}}}
f6bcfd97 1317
1aaf88d2 1318Returns the copy of this object to which
f6bcfd97
BP
1319\helpref{SetToWeekDayInSameWeek}{wxdatetimesettoweekdayinsameweek} was
1320applied.
1321
4c27e2fa 1322
f6bcfd97
BP
1323\membersection{wxDateTime::SetToNextWeekDay}\label{wxdatetimesettonextweekday}
1324
1325\func{wxDateTime\&}{SetToNextWeekDay}{\param{WeekDay }{weekday}}
1326
1327Sets the date so that it will be the first {\it weekday} following the current
1328date.
1329
1330Returns the reference to the modified object itself.
1331
4c27e2fa 1332
f6bcfd97
BP
1333\membersection{wxDateTime::GetNextWeekDay}\label{wxdatetimegetnextweekday}
1334
1335\constfunc{wxDateTime}{GetNextWeekDay}{\param{WeekDay }{weekday}}
1336
1337Returns the copy of this object to which
1338\helpref{SetToNextWeekDay}{wxdatetimesettonextweekday} was applied.
1339
4c27e2fa 1340
f6bcfd97
BP
1341\membersection{wxDateTime::SetToPrevWeekDay}\label{wxdatetimesettoprevweekday}
1342
1343\func{wxDateTime\&}{SetToPrevWeekDay}{\param{WeekDay }{weekday}}
1344
1345Sets the date so that it will be the last {\it weekday} before the current
1346date.
1347
1348Returns the reference to the modified object itself.
1349
4c27e2fa 1350
f6bcfd97
BP
1351\membersection{wxDateTime::GetPrevWeekDay}\label{wxdatetimegetprevweekday}
1352
1353\constfunc{wxDateTime}{GetPrevWeekDay}{\param{WeekDay }{weekday}}
1354
1355Returns the copy of this object to which
1356\helpref{SetToPrevWeekDay}{wxdatetimesettoprevweekday} was applied.
1357
4c27e2fa 1358
f6bcfd97
BP
1359\membersection{wxDateTime::SetToWeekDay}\label{wxdatetimesettoweekday}
1360
1361\func{bool}{SetToWeekDay}{\param{WeekDay }{weekday}, \param{int }{n = 1}, \param{Month }{month = Inv\_Month}, \param{int }{year = Inv\_Year}}
1362
1363Sets the date to the {\it n}-th {\it weekday} in the given month of the given
1364year (the current month and year are used by default). The parameter {\it n}
2edb0bde 1365may be either positive (counting from the beginning of the month) or negative
f6bcfd97
BP
1366(counting from the end of it).
1367
1368For example, {\tt SetToWeekDay(2, wxDateTime::Wed)} will set the date to the
1369second Wednesday in the current month and
cdfb1ae1 1370{\tt SetToWeekDay(-1, wxDateTime::Sun)} -- to the last Sunday in it.
f6bcfd97 1371
cc81d32f 1372Returns {\tt true} if the date was modified successfully, {\tt false}
f6bcfd97
BP
1373otherwise meaning that the specified date doesn't exist.
1374
4c27e2fa 1375
f6bcfd97
BP
1376\membersection{wxDateTime::GetWeekDay}\label{wxdatetimegetweekday2}
1377
1378\constfunc{wxDateTime}{GetWeekDay}{\param{WeekDay }{weekday}, \param{int }{n = 1}, \param{Month }{month = Inv\_Month}, \param{int }{year = Inv\_Year}}
1379
1380Returns the copy of this object to which
1381\helpref{SetToWeekDay}{wxdatetimesettoweekday} was applied.
1382
4c27e2fa 1383
f6bcfd97
BP
1384\membersection{wxDateTime::SetToLastWeekDay}\label{wxdatetimesettolastweekday}
1385
1386\func{bool}{SetToLastWeekDay}{\param{WeekDay }{weekday}, \param{Month }{month = Inv\_Month}, \param{int }{year = Inv\_Year}}
1387
1388The effect of calling this function is the same as of calling
1389{\tt SetToWeekDay(-1, weekday, month, year)}. The date will be set to the last
1390{\it weekday} in the given month and year (the current ones by default).
1391
cc81d32f 1392Always returns {\tt true}.
f6bcfd97 1393
4c27e2fa 1394
f6bcfd97
BP
1395\membersection{wxDateTime::GetLastWeekDay}\label{wxdatetimegetlastweekday}
1396
1397\func{wxDateTime}{GetLastWeekDay}{\param{WeekDay }{weekday}, \param{Month }{month = Inv\_Month}, \param{int }{year = Inv\_Year}}
1398
1399Returns the copy of this object to which
1400\helpref{SetToLastWeekDay}{wxdatetimesettolastweekday} was applied.
1401
f6bcfd97 1402
4c27e2fa 1403\membersection{wxDateTime::SetToWeekOfYear}\label{wxdatetimesettoweekofyear}
f6bcfd97 1404
4c27e2fa 1405\func{static wxDateTime}{SetToWeekOfYear}{\param{int }{year}, \param{wxDateTime\_t }{numWeek}, \param{WeekDay }{weekday = Mon}}
f6bcfd97 1406
4c27e2fa
VZ
1407Set the date to the given \arg{weekday} in the week number \arg{numWeek} of the
1408given \arg{year} . The number should be in range $1\ldots53$.
f6bcfd97 1409
4c27e2fa
VZ
1410Note that the returned date may be in a different year than the one passed to
1411this function because both the week $1$ and week $52$ or $53$ (for leap years)
1aaf88d2 1412contain days from different years. See
4c27e2fa
VZ
1413\helpref{GetWeekOfYear}{wxdatetimegetweekofyear} for the explanation of how the
1414year weeks are counted.
f6bcfd97 1415
f6bcfd97
BP
1416
1417\membersection{wxDateTime::SetToLastMonthDay}\label{wxdatetimesettolastmonthday}
1418
1419\func{wxDateTime\&}{SetToLastMonthDay}{\param{Month }{month = Inv\_Month}, \param{int }{year = Inv\_Year}}
1420
1421Sets the date to the last day in the specified month (the current one by
1422default).
1423
1424Returns the reference to the modified object itself.
1425
4c27e2fa 1426
f6bcfd97
BP
1427\membersection{wxDateTime::GetLastMonthDay}\label{wxdatetimegetlastmonthday}
1428
1429\constfunc{wxDateTime}{GetLastMonthDay}{\param{Month }{month = Inv\_Month}, \param{int }{year = Inv\_Year}}
1430
1431Returns the copy of this object to which
1432\helpref{SetToLastMonthDay}{wxdatetimesettolastmonthday} was applied.
1433
4c27e2fa 1434
f6bcfd97
BP
1435\membersection{wxDateTime::SetToYearDay}\label{wxdatetimesettoyearday}
1436
1437\func{wxDateTime\&}{SetToYearDay}{\param{wxDateTime\_t }{yday}}
1438
1439Sets the date to the day number {\it yday} in the same year (i.e., unlike the
1440other functions, this one does not use the current year). The day number
1441should be in the range $1\ldots366$ for the leap years and $1\ldots365$ for
1442the other ones.
1443
1444Returns the reference to the modified object itself.
1445
4c27e2fa 1446
f6bcfd97
BP
1447\membersection{wxDateTime::GetYearDay}\label{wxdatetimegetyearday}
1448
1449\constfunc{wxDateTime}{GetYearDay}{\param{wxDateTime\_t }{yday}}
1450
1451Returns the copy of this object to which
1452\helpref{SetToYearDay}{wxdatetimesettoyearday} was applied.
1453
1454%%%%%%%%%%%%%%%%%%%%%%%%%%% astronomical functions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1455
4c27e2fa 1456
f6bcfd97
BP
1457\membersection{wxDateTime::GetJulianDayNumber}\label{wxdatetimegetjuliandaynumber}
1458
1459\constfunc{double}{GetJulianDayNumber}{\void}
1460
1461Returns the \helpref{JDN}{wxdatetimesetjdn} corresponding to this date. Beware
1462of rounding errors!
1463
1464\wxheading{See also}
1465
1466\helpref{GetModifiedJulianDayNumber}{wxdatetimegetmodifiedjuliandaynumber}
1467
4c27e2fa 1468
f6bcfd97
BP
1469\membersection{wxDateTime::GetJDN}\label{wxdatetimegetjdn}
1470
1471\constfunc{double}{GetJDN}{\void}
1472
1473Synonym for \helpref{GetJulianDayNumber}{wxdatetimegetjuliandaynumber}.
1474
4c27e2fa 1475
f6bcfd97
BP
1476\membersection{wxDateTime::GetModifiedJulianDayNumber}\label{wxdatetimegetmodifiedjuliandaynumber}
1477
1478\constfunc{double}{GetModifiedJulianDayNumber}{\void}
1479
1480Returns the {\it Modified Julian Day Number} (MJD) which is, by definition,
1481equal to $JDN - 2400000.5$. The MJDs are simpler to work with as the integral
1482MJDs correspond to midnights of the dates in the Gregorian calendar and not th
1483noons like JDN. The MJD $0$ is Nov 17, 1858.
1484
4c27e2fa 1485
f6bcfd97
BP
1486\membersection{wxDateTime::GetMJD}\label{wxdatetimegetmjd}
1487
1488\constfunc{double}{GetMJD}{\void}
1489
1490Synonym for \helpref{GetModifiedJulianDayNumber}{wxdatetimegetmodifiedjuliandaynumber}.
1491
4c27e2fa 1492
f6bcfd97
BP
1493\membersection{wxDateTime::GetRataDie}\label{wxdatetimegetratadie}
1494
1495\constfunc{double}{GetRataDie}{\void}
1496
1497Return the {\it Rata Die number} of this date.
1498
1499By definition, the Rata Die number is a date specified as the number of days
1500relative to a base date of December 31 of the year 0. Thus January 1 of the
1501year 1 is Rata Die day 1.
1502
1503%%%%%%%%%%%%%%%%%%%%%%%%%%% timezone and DST %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1504
4c27e2fa 1505
d26adb9d
VZ
1506\membersection{wxDateTime::FromTimezone}\label{wxdatetimefromtimezone}
1507
1508\constfunc{wxDateTime}{FromTimezone}{\param{const TimeZone\& }{tz}, \param{bool }{noDST = false}}
1509
1510Transform the date from the given time zone to the local one. If {\it noDST} is
1511{\tt true}, no DST adjustments will be made.
1512
1513Returns the date in the local time zone.
1514
1515
f6bcfd97
BP
1516\membersection{wxDateTime::ToTimezone}\label{wxdatetimetotimezone}
1517
cc81d32f 1518\constfunc{wxDateTime}{ToTimezone}{\param{const TimeZone\& }{tz}, \param{bool }{noDST = false}}
f6bcfd97 1519
cc81d32f 1520Transform the date to the given time zone. If {\it noDST} is {\tt true}, no
f6bcfd97
BP
1521DST adjustments will be made.
1522
1523Returns the date in the new time zone.
1524
4c27e2fa 1525
f6bcfd97
BP
1526\membersection{wxDateTime::MakeTimezone}\label{wxdatetimemaketimezone}
1527
cc81d32f 1528\func{wxDateTime\&}{MakeTimezone}{\param{const TimeZone\& }{tz}, \param{bool }{noDST = false}}
f6bcfd97
BP
1529
1530Modifies the object in place to represent the date in another time zone. If
cc81d32f 1531{\it noDST} is {\tt true}, no DST adjustments will be made.
f6bcfd97 1532
4c27e2fa 1533
d26adb9d
VZ
1534\membersection{wxDateTime::MakeFromTimezone}\label{wxdatetimemakefromtimezone}
1535
1536\func{wxDateTime\&}{MakeFromTimezone}{\param{const TimeZone\& }{tz}, \param{bool }{noDST = false}}
1537
1538Same as \helpref{FromTimezone}{wxdatetimefromtimezone} but modifies the object
1539in place.
1540
1541
1542\membersection{wxDateTime::ToUTC}\label{wxdatetimetoutc}
f6bcfd97 1543
d26adb9d 1544\constfunc{wxDateTime}{ToUTC}{\param{bool }{noDST = false}}
f6bcfd97
BP
1545
1546This is the same as calling \helpref{ToTimezone}{wxdatetimetotimezone} with
1547the argument {\tt GMT0}.
1548
4c27e2fa 1549
d26adb9d 1550\membersection{wxDateTime::MakeUTC}\label{wxdatetimemakeutc}
f6bcfd97 1551
d26adb9d 1552\func{wxDateTime\&}{MakeUTC}{\param{bool }{noDST = false}}
f6bcfd97
BP
1553
1554This is the same as calling \helpref{MakeTimezone}{wxdatetimemaketimezone} with
1555the argument {\tt GMT0}.
1556
4c27e2fa 1557
f6bcfd97
BP
1558\membersection{wxDateTime::IsDST}\label{wxdatetimeisdst}
1559
1560\constfunc{int}{IsDST}{\param{Country }{country = Country\_Default}}
1561
cc81d32f 1562Returns {\tt true} if the DST is applied for this date in the given country.
f6bcfd97
BP
1563
1564\wxheading{See also}
1565
1566\helpref{GetBeginDST}{wxdatetimegetbegindst} and
1567\helpref{GetEndDST}{wxdatetimegetenddst}
1568
1569\section{\class{wxDateTimeHolidayAuthority}}\label{wxdatetimeholidayauthority}
1570
991ad6cd
VZ
1571\wxheading{Derived from}
1572
1573No base class
1574
1575\wxheading{Include files}
1576
1577<wx/datetime.h>
1578
a7af285d
VZ
1579\wxheading{Library}
1580
1581\helpref{wxBase}{librarieslist}
1582
991ad6cd
VZ
1583\latexignore{\rtfignore{\wxheading{Members}}}
1584
f6bcfd97
BP
1585TODO
1586
1587\section{\class{wxDateTimeWorkDays}}\label{wxdatetimeworkdays}
1588
991ad6cd
VZ
1589\wxheading{Derived from}
1590
1591No base class
1592
1593\wxheading{Include files}
1594
1595<wx/datetime.h>
1596
a7af285d
VZ
1597\wxheading{Library}
1598
1599\helpref{wxBase}{librarieslist}
1600
991ad6cd
VZ
1601\latexignore{\rtfignore{\wxheading{Members}}}
1602
f6bcfd97
BP
1603TODO
1604