]> git.saurik.com Git - wxWidgets.git/blob - interface/datetime.h
Fix AdjustForOverflow to use item->CalcMin, not item->GetSize
[wxWidgets.git] / interface / datetime.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: datetime.h
3 // Purpose: interface of wxDateTime
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxDateTime
11 @wxheader{datetime.h}
12
13 wxDateTime class represents an absolute moment in the time.
14
15 @library{wxbase}
16 @category{data}
17
18 @see @ref overview_wxdatetimeoverview "Date classes overview", wxTimeSpan,
19 wxDateSpan, wxCalendarCtrl
20 */
21 class wxDateTime
22 {
23 public:
24 /**
25 Same as @ref setdate() Set
26 */
27 wxDateTime(wxDateTime_t day, Month month = Inv_Month,
28 int year = Inv_Year, wxDateTime_t hour = 0,
29 wxDateTime_t minute = 0,
30 wxDateTime_t second = 0,
31 wxDateTime_t millisec = 0);
32
33 /**
34 Here are the trivial accessors. Other functions, which might have to perform
35 some more complicated calculations to find the answer are under the
36 @ref overview_datetimecalculations "Calendar calculations" section.
37 IsValid()
38
39 GetTicks()
40
41 GetCentury()
42
43 GetYear()
44
45 GetMonth()
46
47 GetDay()
48
49 GetWeekDay()
50
51 GetHour()
52
53 GetMinute()
54
55 GetSecond()
56
57 GetMillisecond()
58
59 GetDayOfYear()
60
61 GetWeekOfYear()
62
63 GetWeekOfMonth()
64
65 GetYearDay()
66
67 IsWorkDay()
68
69 IsGregorianDate()
70
71 GetAsDOS()
72 */
73
74
75 //@{
76 /**
77 Adds the given date span to this object.
78 */
79 wxDateTime Add(const wxDateSpan& diff);
80 const wxDateTime& Add(const wxDateSpan& diff);
81 wxDateTime operator+=(const wxDateSpan& diff);
82 //@}
83
84 /**
85 Some degree of support for the date units used in astronomy and/or history is
86 provided. You can construct a wxDateTime object from a
87 @ref setjdn() JDN and you may also get its JDN,
88 @ref getmodifiedjuliandaynumber() MJD or
89 @ref getratadie() "Rata Die number" from it.
90 @ref wxdatetimejdn() "wxDateTime(double jdn)"
91
92 @ref setjdn() "Set(double jdn)"
93
94 GetJulianDayNumber()
95
96 GetJDN()
97
98 GetModifiedJulianDayNumber()
99
100 GetMJD()
101
102 GetRataDie()
103 */
104
105
106 /**
107 The functions in this section perform the basic calendar calculations, mostly
108 related to the week days. They allow to find the given week day in the
109 week with given number (either in the month or in the year) and so on.
110 All (non-const) functions in this section don't modify the time part of the
111 wxDateTime -- they only work with the date part of it.
112 SetToWeekDayInSameWeek()
113
114 GetWeekDayInSameWeek()
115
116 SetToNextWeekDay()
117
118 GetNextWeekDay()
119
120 SetToPrevWeekDay()
121
122 GetPrevWeekDay()
123
124 SetToWeekDay()
125
126 @ref wxDateTime::getweekday2 GetWeekDay
127
128 SetToLastWeekDay()
129
130 GetLastWeekDay()
131
132 SetToWeekOfYear()
133
134 SetToLastMonthDay()
135
136 GetLastMonthDay()
137
138 SetToYearDay()
139
140 GetYearDay()
141 */
142
143
144 /**
145 Constructors and various @c Set() methods are collected here. If you
146 construct a date object from separate values for day, month and year, you
147 should use IsValid() method to check that the
148 values were correct as constructors can not return an error code.
149 @ref wxdatetimedef() wxDateTime
150
151 @ref wxdatetimetimet() wxDateTime(time_t)
152
153 @ref wxdatetimetm() "wxDateTime(struct tm)"
154
155 @ref wxdatetimejdn() "wxDateTime(double jdn)"
156
157 @ref wxdatetimetime() "wxDateTime(h, m, s, ms)"
158
159 @ref wxdatetimedate() "wxDateTime(day, mon, year, h, m, s, ms)"
160
161 SetToCurrent()
162
163 @ref settimet() Set(time_t)
164
165 @ref settm() "Set(struct tm)"
166
167 @ref setjdn() "Set(double jdn)"
168
169 @ref settime() "Set(h, m, s, ms)"
170
171 @ref setdate() "Set(day, mon, year, h, m, s, ms)"
172
173 @ref setfromdos() "SetFromDOS(unsigned long ddt)"
174
175 ResetTime()
176
177 SetYear()
178
179 SetMonth()
180
181 @ref setdate() SetDay
182
183 SetHour()
184
185 SetMinute()
186
187 SetSecond()
188
189 SetMillisecond()
190
191 @ref operatoreqtimet() operator=(time_t)
192
193 @ref operatoreqtm() "operator=(struct tm)"
194 */
195
196
197 /**
198 Converts the year in absolute notation (i.e. a number which can be negative,
199 positive or zero) to the year in BC/AD notation. For the positive years,
200 nothing is done, but the year 0 is year 1 BC and so for other years there is a
201 difference of 1.
202 This function should be used like this:
203 */
204 static int ConvertYearToBC(int year);
205
206 /**
207 These functions carry out arithmetics() on the wxDateTime
208 objects. As explained in the overview, either wxTimeSpan or wxDateSpan may be
209 added to wxDateTime, hence all functions are overloaded to accept both
210 arguments.
211 Also, both @c Add() and @c Subtract() have both const and non-const
212 version. The first one returns a new object which represents the
213 sum/difference of the original one with the argument while the second form
214 modifies the object to which it is applied. The operators -= and += are
215 defined to be equivalent to the second forms of these functions.
216 @ref addts() Add(wxTimeSpan)
217
218 @ref addds() Add(wxDateSpan)
219
220 @ref subtractts() Subtract(wxTimeSpan)
221
222 @ref subtractds() Subtract(wxDateSpan)
223
224 @ref subtractdt() Subtract(wxDateTime)
225
226 @ref addts() oparator+=(wxTimeSpan)
227
228 @ref addds() oparator+=(wxDateSpan)
229
230 @ref subtractts() oparator-=(wxTimeSpan)
231
232 @ref subtractds() oparator-=(wxDateSpan)
233 */
234
235
236 /**
237 There are several function to allow date comparison. To supplement them, a few
238 global operators , etc taking wxDateTime are defined.
239 IsEqualTo()
240
241 IsEarlierThan()
242
243 IsLaterThan()
244
245 IsStrictlyBetween()
246
247 IsBetween()
248
249 IsSameDate()
250
251 IsSameTime()
252
253 IsEqualUpTo()
254 */
255
256
257 /**
258 This function does the same as the standard ANSI C @c strftime(3) function.
259 Please see its description for the meaning of @a format parameter.
260 It also accepts a few wxWidgets-specific extensions: you can optionally specify
261 the width of the field to follow using @c printf(3)-like syntax and the
262 format specification @c %l can be used to get the number of milliseconds.
263
264 @see ParseFormat()
265 */
266 wxString Format(const wxChar* format = wxDefaultDateTimeFormat,
267 const TimeZone& tz = Local) const;
268
269 /**
270 Identical to calling Format() with @c "%x"
271 argument (which means 'preferred date representation for the current locale').
272 */
273 wxString FormatDate() const;
274
275 /**
276 Returns the combined date-time representation in the ISO 8601 format
277 (YYYY-MM-DDTHH:MM:SS). The @a sep parameter default value produces the
278 result exactly corresponding to the ISO standard, but it can also be useful to
279 use a space as seprator if a more human-readable combined date-time
280 representation is needed.
281
282 @see FormatISODate(), FormatISOTime(),
283 ParseISOCombined()
284 */
285 wxString FormatISOCombined(char sep = 'T') const;
286
287 /**
288 This function returns the date representation in the ISO 8601 format
289 (YYYY-MM-DD).
290 */
291 wxString FormatISODate() const;
292
293 /**
294 This function returns the time representation in the ISO 8601 format
295 (HH:MM:SS).
296 */
297 wxString FormatISOTime() const;
298
299 /**
300 Identical to calling Format() with @c "%X"
301 argument (which means 'preferred time representation for the current locale').
302 */
303 wxString FormatTime() const;
304
305 /**
306 Transform the date from the given time zone to the local one. If @a noDST is
307 @true, no DST adjustments will be made.
308 Returns the date in the local time zone.
309 */
310 wxDateTime FromTimezone(const TimeZone& tz,
311 bool noDST = false) const;
312
313 /**
314 Returns the translations of the strings @c AM and @c PM used for time
315 formatting for the current locale. Either of the pointers may be @NULL if
316 the corresponding value is not needed.
317 */
318 static void GetAmPmStrings(wxString* am, wxString* pm);
319
320 /**
321 Returns the date and time in
322 DOS
323 format.
324 */
325 long unsigned int GetAsDOS() const;
326
327 /**
328 Get the beginning of DST for the given country in the given year (current one
329 by default). This function suffers from limitations described in
330 @ref overview_tdatedst "DST overview".
331
332 @see GetEndDST()
333 */
334 static wxDateTime GetBeginDST(int year = Inv_Year,
335 Country country = Country_Default);
336
337 /**
338 Returns the century of this date.
339 */
340 int GetCentury(const TimeZone& tz = Local) const;
341
342 /**
343 Returns the current default country. The default country is used for DST
344 calculations, for example.
345
346 @see SetCountry()
347 */
348 static Country GetCountry();
349
350 /**
351 Get the current month in given calendar (only Gregorian is currently supported).
352 */
353 static Month GetCurrentMonth(Calendar cal = Gregorian);
354
355 /**
356 Get the current year in given calendar (only Gregorian is currently supported).
357 */
358 static int GetCurrentYear(Calendar cal = Gregorian);
359
360 /**
361 Returns the object having the same date component as this one but time of
362 00:00:00.
363
364 @wxsince{2.8.2}
365
366 @see ResetTime()
367 */
368 wxDateTime GetDateOnly() const;
369
370 /**
371 Returns the day in the given timezone (local one by default).
372 */
373 short unsigned int GetDay(const TimeZone& tz = Local) const;
374
375 /**
376 Returns the day of the year (in 1...366 range) in the given timezone
377 (local one by default).
378 */
379 short unsigned int GetDayOfYear(const TimeZone& tz = Local) const;
380
381 /**
382 Returns the end of DST for the given country in the given year (current one by
383 default).
384
385 @see GetBeginDST()
386 */
387 static wxDateTime GetEndDST(int year = Inv_Year,
388 Country country = Country_Default);
389
390 /**
391 Returns the hour in the given timezone (local one by default).
392 */
393 short unsigned int GetHour(const TimeZone& tz = Local) const;
394
395 /**
396 Synonym for GetJulianDayNumber().
397 */
398 double GetJDN() const;
399
400 /**
401 Returns the @ref setjdn() JDN corresponding to this date. Beware
402 of rounding errors!
403
404 @see GetModifiedJulianDayNumber()
405 */
406 double GetJulianDayNumber() const;
407
408 /**
409 Returns the copy of this object to which
410 SetToLastMonthDay() was applied.
411 */
412 wxDateTime GetLastMonthDay(Month month = Inv_Month,
413 int year = Inv_Year) const;
414
415 /**
416 Returns the copy of this object to which
417 SetToLastWeekDay() was applied.
418 */
419 wxDateTime GetLastWeekDay(WeekDay weekday,
420 Month month = Inv_Month,
421 int year = Inv_Year);
422
423 /**
424 Synonym for GetModifiedJulianDayNumber().
425 */
426 double GetMJD() const;
427
428 /**
429 Returns the milliseconds in the given timezone (local one by default).
430 */
431 short unsigned int GetMillisecond(const TimeZone& tz = Local) const;
432
433 /**
434 Returns the minute in the given timezone (local one by default).
435 */
436 short unsigned int GetMinute(const TimeZone& tz = Local) const;
437
438 /**
439 Returns the @e Modified Julian Day Number (MJD) which is, by definition,
440 equal to JDN - 2400000.5. The MJDs are simpler to work with as the integral
441 MJDs correspond to midnights of the dates in the Gregorian calendar and not th
442 noons like JDN. The MJD 0 is Nov 17, 1858.
443 */
444 double GetModifiedJulianDayNumber() const;
445
446 /**
447 Returns the month in the given timezone (local one by default).
448 */
449 Month GetMonth(const TimeZone& tz = Local) const;
450
451 /**
452 Gets the full (default) or abbreviated (specify @c Name_Abbr name of the
453 given month.
454
455 @see GetWeekDayName()
456 */
457 static wxString GetMonthName(Month month,
458 NameFlags flags = Name_Full);
459
460 /**
461 Returns the copy of this object to which
462 SetToNextWeekDay() was applied.
463 */
464 wxDateTime GetNextWeekDay(WeekDay weekday) const;
465
466 //@{
467 /**
468 Returns the number of days in the given year or in the given month of the
469 year.
470 The only supported value for @a cal parameter is currently @c Gregorian.
471 */
472 static wxDateTime_t GetNumberOfDays(int year,
473 Calendar cal = Gregorian);
474 static wxDateTime_t GetNumberOfDays(Month month,
475 int year = Inv_Year,
476 Calendar cal = Gregorian);
477 //@}
478
479 /**
480 Returns the copy of this object to which
481 SetToPrevWeekDay() was applied.
482 */
483 wxDateTime GetPrevWeekDay(WeekDay weekday) const;
484
485 /**
486 Return the @e Rata Die number of this date.
487 By definition, the Rata Die number is a date specified as the number of days
488 relative to a base date of December 31 of the year 0. Thus January 1 of the
489 year 1 is Rata Die day 1.
490 */
491 double GetRataDie() const;
492
493 /**
494 Returns the seconds in the given timezone (local one by default).
495 */
496 short unsigned int GetSecond(const TimeZone& tz = Local) const;
497
498 /**
499 Returns the number of seconds since Jan 1, 1970. An assert failure will occur
500 if the date is not in the range covered by @c time_t type.
501 */
502 time_t GetTicks() const;
503
504 /**
505 Returns the current time.
506 */
507 static time_t GetTimeNow();
508
509 /**
510 Returns broken down representation of the date and time.
511 */
512 Tm GetTm(const TimeZone& tz = Local) const;
513
514 /**
515 Returns the current time broken down. Note that this function returns a
516 pointer to a static buffer that's reused by calls to this function and
517 certain C library functions (e.g. localtime). If there is any chance your
518 code might be used in a multi-threaded application, you really should use
519 the flavour of function GetTmNow()
520 taking a parameter.
521 */
522 static struct tm* GetTmNow();
523
524 /**
525 Returns the copy of this object to which
526 SetToWeekDay() was applied.
527 */
528 wxDateTime GetWeekDay(WeekDay weekday, int n = 1,
529 Month month = Inv_Month,
530 int year = Inv_Year) const;
531
532 /**
533 Returns the copy of this object to which
534 SetToWeekDayInSameWeek() was
535 applied.
536 */
537 wxDateTime GetWeekDayInSameWeek(WeekDay weekday,
538 WeekFlags flags = Monday_First) const;
539
540 /**
541 Gets the full (default) or abbreviated (specify @c Name_Abbr name of the
542 given week day.
543
544 @see GetMonthName()
545 */
546 static wxString GetWeekDayName(WeekDay weekday,
547 NameFlags flags = Name_Full);
548
549 /**
550 Returns the ordinal number of the week in the month (in 1...5 range).
551 As GetWeekOfYear(), this function supports
552 both conventions for the week start. See the description of these
553 @ref overview_wxdatetime "week start" conventions.
554 */
555 wxDateTime_t GetWeekOfMonth(WeekFlags flags = Monday_First,
556 const TimeZone& tz = Local) const;
557
558 /**
559 Returns the number of the week of the year this date is in. The first week of
560 the year is, according to international standards, the one containing Jan 4 or,
561 equivalently, the first week which has Thursday in this year. Both of these
562 definitions are the same as saying that the first week of the year must contain
563 more than half of its days in this year. Accordingly, the week number will
564 always be in 1...53 range (52 for non-leap years).
565 The function depends on the @ref overview_wxdatetime "week start" convention
566 specified by the @a flags argument but its results for
567 @c Sunday_First are not well-defined as the ISO definition quoted above
568 applies to the weeks starting on Monday only.
569 */
570 wxDateTime_t GetWeekOfYear(WeekFlags flags = Monday_First,
571 const TimeZone& tz = Local) const;
572
573 /**
574 Returns the year in the given timezone (local one by default).
575 */
576 int GetYear(const TimeZone& tz = Local) const;
577
578 /**
579 Returns the copy of this object to which
580 SetToYearDay() was applied.
581 */
582 wxDateTime GetYearDay(short unsigned int) const;
583
584 /**
585 Returns @true if IsStrictlyBetween()
586 is @true or if the date is equal to one of the limit values.
587
588 @see IsStrictlyBetween()
589 */
590 bool IsBetween(const wxDateTime& t1, const wxDateTime& t2) const;
591
592 /**
593 Returns @true if the DST is applied for this date in the given country.
594 */
595 int IsDST(Country country = Country_Default) const;
596
597 /**
598 Returns @true if DST was used n the given year (the current one by
599 default) in the given country.
600 */
601 static bool IsDSTApplicable(int year = Inv_Year,
602 Country country = Country_Default);
603
604 /**
605 Returns @true if this date precedes the given one.
606 */
607 bool IsEarlierThan(const wxDateTime& datetime) const;
608
609 /**
610 Returns @true if the two dates are strictly identical.
611 */
612 bool IsEqualTo(const wxDateTime& datetime) const;
613
614 /**
615 Returns @true if the date is equal to another one up to the given time
616 interval, i.e. if the absolute difference between the two dates is less than
617 this interval.
618 */
619 bool IsEqualUpTo(const wxDateTime& dt, const wxTimeSpan& ts) const;
620
621 /**
622 Returns @true if the given date is later than the date of adoption of the
623 Gregorian calendar in the given country (and hence the Gregorian calendar
624 calculations make sense for it).
625 */
626 bool IsGregorianDate(GregorianAdoption country = Gr_Standard) const;
627
628 /**
629 Returns @true if this date is later than the given one.
630 */
631 bool IsLaterThan(const wxDateTime& datetime) const;
632
633 /**
634 Returns @true if the @a year is a leap one in the specified calendar.
635 This functions supports Gregorian and Julian calendars.
636 */
637 static bool IsLeapYear(int year = Inv_Year,
638 Calendar cal = Gregorian);
639
640 /**
641 Returns @true if the date is the same without comparing the time parts.
642 */
643 bool IsSameDate(const wxDateTime& dt) const;
644
645 /**
646 Returns @true if the time is the same (although dates may differ).
647 */
648 bool IsSameTime(const wxDateTime& dt) const;
649
650 /**
651 Returns @true if this date lies strictly between the two others,
652
653 @see IsBetween()
654 */
655 bool IsStrictlyBetween(const wxDateTime& t1,
656 const wxDateTime& t2) const;
657
658 /**
659 Returns @true if the object represents a valid time moment.
660 */
661 bool IsValid() const;
662
663 /**
664 This function returns @true if the specified (or default) country is one
665 of Western European ones. It is used internally by wxDateTime to determine the
666 DST convention and date and time formatting rules.
667 */
668 static bool IsWestEuropeanCountry(Country country = Country_Default);
669
670 /**
671 Returns @true is this day is not a holiday in the given country.
672 */
673 bool IsWorkDay(Country country = Country_Default) const;
674
675 /**
676 Same as FromTimezone() but modifies the object
677 in place.
678 */
679 wxDateTime MakeFromTimezone(const TimeZone& tz,
680 bool noDST = false);
681
682 /**
683 Modifies the object in place to represent the date in another time zone. If
684 @a noDST is @true, no DST adjustments will be made.
685 */
686 wxDateTime MakeTimezone(const TimeZone& tz,
687 bool noDST = false);
688
689 /**
690 This is the same as calling MakeTimezone() with
691 the argument @c GMT0.
692 */
693 wxDateTime& MakeUTC(bool noDST = false);
694
695 /**
696 Returns the object corresponding to the current time.
697 Example:
698
699 Note that this function is accurate up to second:
700 UNow() should be used for better precision
701 (but it is less efficient and might not be available on all platforms).
702
703 @see Today()
704 */
705 static wxDateTime Now();
706
707 //@{
708 /**
709 This function is like ParseDateTime(), but it
710 only allows the date to be specified. It is thus less flexible then
711 ParseDateTime(), but also has less chances to
712 misinterpret the user input.
713 Returns @NULL if the conversion failed, otherwise return the pointer to
714 the character which stopped the scan.
715 */
716 const char* ParseDate(const wxString& date,
717 wxString::const_iterator* end = NULL);
718 const char* ParseDate(const char* date);
719 const wchar_t* ParseDate(const wchar_t* date);
720 //@}
721
722 //@{
723 /**
724 Parses the string @a datetime containing the date and time in free format.
725 This function tries as hard as it can to interpret the given string as date
726 and time. Unlike wxDateTime::ParseRfc822Date, it
727 will accept anything that may be accepted and will only reject strings which
728 can not be parsed in any way at all.
729 Returns @NULL if the conversion failed, otherwise return the pointer to
730 the character which stopped the scan.
731 */
732 const char* ParseDateTime(const wxString& datetime,
733 wxString::const_iterator* end = NULL);
734 const char* ParseDateTime(const char* datetime);
735 const wchar_t* ParseDateTime(const wchar_t* datetime);
736 //@}
737
738 //@{
739 /**
740 This function parses the string @a date according to the given
741 @e format. The system @c strptime(3) function is used whenever available,
742 but even if it is not, this function is still implemented, although support
743 for locale-dependent format specifiers such as @c "%c", @c "%x" or @c "%X" may
744 not be perfect and GNU extensions such as @c "%z" and @c "%Z" are
745 not implemented. This function does handle the month and weekday
746 names in the current locale on all platforms, however.
747 Please see the description of the ANSI C function @c strftime(3) for the syntax
748 of the format string.
749 The @a dateDef parameter is used to fill in the fields which could not be
750 determined from the format string. For example, if the format is @c "%d" (the
751 ay of the month), the month and the year are taken from @e dateDef. If
752 it is not specified, Today() is used as the
753 default date.
754 Returns @NULL if the conversion failed, otherwise return the pointer to
755 the character which stopped the scan.
756 */
757 const char* ParseFormat(const wxString& date,
758 const wxString& format = wxDefaultDateTimeFormat,
759 const wxDateTime& dateDef = wxDefaultDateTime,
760 wxString::const_iterator* end = NULL);
761 const char* ParseFormat(const char* date,
762 const wxString& format = wxDefaultDateTimeFormat,
763 const wxDateTime& dateDef = wxDefaultDateTime);
764 const wchar_t* ParseFormat(const wchar_t* date,
765 const wxString& format = wxDefaultDateTimeFormat,
766 const wxDateTime& dateDef = wxDefaultDateTime);
767 //@}
768
769 /**
770 This function parses the string containing the date and time in ISO 8601
771 combined format (YYYY-MM-DDTHH:MM:SS). The separator between the date and time
772 parts must be equal to @a sep for the function to succeed.
773 Returns @true if the entire string was parsed successfully, @false
774 otherwise.
775 */
776 bool ParseISOCombined(const wxString& date, char sep = 'T');
777
778 /**
779 This function parses the date in ISO 8601 format (YYYY-MM-DD).
780 Returns @true if the entire string was parsed successfully, @false
781 otherwise.
782 */
783 bool ParseISODate(const wxString& date);
784
785 /**
786 This function parses the time in ISO 8601 format (HH:MM:SS).
787 Returns @true if the entire string was parsed successfully, @false
788 otherwise.
789 */
790 bool ParseISOTime(const wxString& date);
791
792 //@{
793 /**
794 Parses the string @a date looking for a date formatted according to the RFC
795 822 in it. The exact description of this format may, of course, be found in
796 the RFC (section 5), but, briefly, this is the format used in the headers of
797 Internet email messages and one of the most common strings expressing date in
798 this format may be something like @c "Sat, 18 Dec 1999 00:48:30 +0100".
799 Returns @NULL if the conversion failed, otherwise return the pointer to
800 the character immediately following the part of the string which could be
801 parsed. If the entire string contains only the date in RFC 822 format,
802 the returned pointer will be pointing to a @c NUL character.
803 This function is intentionally strict, it will return an error for any string
804 which is not RFC 822 compliant. If you need to parse date formatted in more
805 free ways, you should use ParseDateTime() or
806 ParseDate() instead.
807 */
808 const char* ParseRfc822Date(const wxString& date,
809 wxString::const_iterator* end = NULL);
810 const char* ParseRfc822Date(const char* date);
811 const wchar_t* ParseRfc822Date(const wchar_t* date);
812 //@}
813
814 //@{
815 /**
816 This functions is like ParseDateTime(), but
817 only allows the time to be specified in the input string.
818 Returns @NULL if the conversion failed, otherwise return the pointer to
819 the character which stopped the scan.
820 */
821 const char* ParseTime(const wxString& time,
822 wxString::const_iterator* end = NULL);
823 const char* ParseTime(const char* time);
824 const wchar_t* ParseTime(const wchar_t* time);
825 //@}
826
827 /**
828 These functions convert wxDateTime objects to and from text. The
829 conversions to text are mostly trivial: you can either do it using the default
830 date and time representations for the current locale (
831 FormatDate() and
832 wxDateTime::FormatTime), using the international standard
833 representation defined by ISO 8601 (
834 FormatISODate(),
835 FormatISOTime() and
836 wxDateTime::FormatISOCombined) or by specifying any
837 format at all and using Format() directly.
838 The conversions from text are more interesting, as there are much more
839 possibilities to care about. The simplest cases can be taken care of with
840 ParseFormat() which can parse any date in the
841 given (rigid) format. wxDateTime::ParseRfc822Date is
842 another function for parsing dates in predefined format -- the one of RFC 822
843 which (still...) defines the format of email messages on the Internet. This
844 format can not be described with @c strptime(3)-like format strings used by
845 Format(), hence the need for a separate function.
846 But the most interesting functions are
847 ParseTime(),
848 ParseDate() and
849 ParseDateTime(). They try to parse the date
850 ans time (or only one of them) in 'free' format, i.e. allow them to be
851 specified in any of possible ways. These functions will usually be used to
852 parse the (interactive) user input which is not bound to be in any predefined
853 format. As an example, ParseDateTime() can
854 parse the strings such as @c "tomorrow", @c "March first" and even
855 @c "next Sunday".
856 Finally notice that each of the parsing functions is available in several
857 overloads: if the input string is a narrow (@c char *) string, then a
858 narrow pointer is returned. If the input string is a wide string, a wide char
859 pointer is returned. Finally, if the input parameter is a wxString, a narrow
860 char pointer is also returned for backwards compatibility but there is also an
861 additional argument of wxString::const_iterator type in which, if it is not
862 @NULL, an iterator pointing to the end of the scanned string part is returned.
863 ParseFormat()
864
865 ParseDateTime()
866
867 ParseDate()
868
869 ParseTime()
870
871 ParseISODate()
872
873 ParseISOTime()
874
875 ParseISOCombined()
876
877 wxDateTime::ParseRfc822Date
878
879 Format()
880
881 FormatDate()
882
883 FormatTime()
884
885 FormatISOCombined()
886
887 FormatISODate()
888
889 FormatISOTime()
890 */
891
892
893 /**
894 Reset time to midnight (00:00:00) without changing the date.
895 */
896 wxDateTime& ResetTime();
897
898 /**
899 Sets the date and time from the parameters.
900 */
901 wxDateTime Set(wxDateTime_t day, Month month = Inv_Month,
902 int year = Inv_Year,
903 wxDateTime_t hour = 0,
904 wxDateTime_t minute = 0,
905 wxDateTime_t second = 0,
906 wxDateTime_t millisec = 0);
907
908 /**
909 Sets the country to use by default. This setting influences the DST
910 calculations, date formatting and other things.
911 The possible values for @a country parameter are enumerated in
912 @ref overview_wxdatetime "wxDateTime constants section".
913
914 @see GetCountry()
915 */
916 static void SetCountry(Country country);
917
918 /**
919 Sets the day without changing other date components.
920 */
921 wxDateTime& SetDay(short unsigned int);
922
923 /**
924 Sets the date from the date and time in
925 DOS
926 format.
927 */
928 wxDateTime Set(unsigned long ddt);
929
930 /**
931 Sets the hour without changing other date components.
932 */
933 wxDateTime& SetHour(short unsigned int);
934
935 /**
936 Sets the millisecond without changing other date components.
937 */
938 wxDateTime& SetMillisecond(short unsigned int);
939
940 /**
941 Sets the minute without changing other date components.
942 */
943 wxDateTime& SetMinute(short unsigned int);
944
945 /**
946 Sets the month without changing other date components.
947 */
948 wxDateTime& SetMonth(Month month);
949
950 /**
951 Sets the second without changing other date components.
952 */
953 wxDateTime& SetSecond(short unsigned int);
954
955 /**
956 Sets the date and time of to the current values. Same as assigning the result
957 of Now() to this object.
958 */
959 wxDateTime& SetToCurrent();
960
961 /**
962 Sets the date to the last day in the specified month (the current one by
963 default).
964 Returns the reference to the modified object itself.
965 */
966 wxDateTime SetToLastMonthDay(Month month = Inv_Month,
967 int year = Inv_Year);
968
969 /**
970 The effect of calling this function is the same as of calling
971 @c SetToWeekDay(-1, weekday, month, year). The date will be set to the last
972 @a weekday in the given month and year (the current ones by default).
973 Always returns @true.
974 */
975 bool SetToLastWeekDay(WeekDay weekday, Month month = Inv_Month,
976 int year = Inv_Year);
977
978 /**
979 Sets the date so that it will be the first @a weekday following the current
980 date.
981 Returns the reference to the modified object itself.
982 */
983 wxDateTime& SetToNextWeekDay(WeekDay weekday);
984
985 /**
986 Sets the date so that it will be the last @a weekday before the current
987 date.
988 Returns the reference to the modified object itself.
989 */
990 wxDateTime& SetToPrevWeekDay(WeekDay weekday);
991
992 /**
993 Sets the date to the @e n-th @a weekday in the given month of the given
994 year (the current month and year are used by default). The parameter @e n
995 may be either positive (counting from the beginning of the month) or negative
996 (counting from the end of it).
997 For example, @c SetToWeekDay(2, wxDateTime::Wed) will set the date to the
998 second Wednesday in the current month and
999 @c SetToWeekDay(-1, wxDateTime::Sun) -- to the last Sunday in it.
1000 Returns @true if the date was modified successfully, @false
1001 otherwise meaning that the specified date doesn't exist.
1002 */
1003 bool SetToWeekDay(WeekDay weekday, int n = 1,
1004 Month month = Inv_Month,
1005 int year = Inv_Year);
1006
1007 /**
1008 Adjusts the date so that it will still lie in the same week as before, but its
1009 week day will be the given one.
1010 Returns the reference to the modified object itself.
1011 */
1012 wxDateTime SetToWeekDayInSameWeek(WeekDay weekday,
1013 WeekFlags flags = Monday_First);
1014
1015 /**
1016 Set the date to the given @a weekday in the week number @a numWeek of the
1017 given @a year . The number should be in range 1...53.
1018 Note that the returned date may be in a different year than the one passed to
1019 this function because both the week 1 and week 52 or 53 (for leap years)
1020 contain days from different years. See
1021 GetWeekOfYear() for the explanation of how the
1022 year weeks are counted.
1023 */
1024 static wxDateTime SetToWeekOfYear(int year, wxDateTime_t numWeek,
1025 WeekDay weekday = Mon);
1026
1027 /**
1028 Sets the date to the day number @a yday in the same year (i.e., unlike the
1029 other functions, this one does not use the current year). The day number
1030 should be in the range 1...366 for the leap years and 1...365 for
1031 the other ones.
1032 Returns the reference to the modified object itself.
1033 */
1034 wxDateTime& SetToYearDay(short unsigned int);
1035
1036 /**
1037 Sets the year without changing other date components.
1038 */
1039 wxDateTime& SetYear(int year);
1040
1041 /**
1042 For convenience, all static functions are collected here. These functions
1043 either set or return the static variables of wxDateSpan (the country), return
1044 the current moment, year, month or number of days in it, or do some general
1045 calendar-related actions.
1046 Please note that although several function accept an extra @e Calendar
1047 parameter, it is currently ignored as only the Gregorian calendar is
1048 supported. Future versions will support other calendars.
1049
1050 SetCountry()
1051
1052 GetCountry()
1053
1054 IsWestEuropeanCountry()
1055
1056 GetCurrentYear()
1057
1058 ConvertYearToBC()
1059
1060 GetCurrentMonth()
1061
1062 IsLeapYear()
1063
1064 @ref getcenturystatic() GetCentury
1065
1066 GetNumberOfDays()
1067
1068 GetNumberOfDays()
1069
1070 GetMonthName()
1071
1072 GetWeekDayName()
1073
1074 GetAmPmStrings()
1075
1076 IsDSTApplicable()
1077
1078 GetBeginDST()
1079
1080 GetEndDST()
1081
1082 Now()
1083
1084 UNow()
1085
1086 Today()
1087 */
1088
1089
1090 /**
1091 Subtracts another date from this one and returns the difference between them
1092 as wxTimeSpan.
1093 */
1094 wxTimeSpan Subtract(const wxDateTime& dt) const;
1095
1096 /**
1097 Please see the @ref overview_tdatetimezones "time zone overview" for more
1098 information about time zones. Normally, these functions should be rarely used.
1099 FromTimezone()
1100
1101 ToTimezone()
1102
1103 MakeTimezone()
1104
1105 MakeFromTimezone()
1106
1107 ToUTC()
1108
1109 MakeUTC()
1110
1111 GetBeginDST()
1112
1113 GetEndDST()
1114
1115 IsDST()
1116 */
1117
1118
1119 /**
1120 Transform the date to the given time zone. If @a noDST is @true, no
1121 DST adjustments will be made.
1122 Returns the date in the new time zone.
1123 */
1124 wxDateTime ToTimezone(const TimeZone& tz, bool noDST = false) const;
1125
1126 /**
1127 This is the same as calling ToTimezone() with
1128 the argument @c GMT0.
1129 */
1130 wxDateTime ToUTC(bool noDST = false) const;
1131
1132 /**
1133 Returns the object corresponding to the midnight of the current day (i.e. the
1134 same as Now(), but the time part is set to 0).
1135
1136 @see Now()
1137 */
1138 static wxDateTime Today();
1139
1140 /**
1141 Returns the object corresponding to the current time including the
1142 milliseconds if a function to get time with such precision is available on the
1143 current platform (supported under most Unices and Win32).
1144
1145 @see Now()
1146 */
1147 static wxDateTime UNow();
1148
1149 /**
1150 Same as @ref settm() Set.
1151 */
1152 wxDateTime operator(const struct tm& tm);
1153 };
1154
1155
1156
1157 /**
1158 @class wxDateTimeWorkDays
1159 @wxheader{datetime.h}
1160
1161
1162 @library{wxbase}
1163 @category{FIXME}
1164 */
1165 class wxDateTimeWorkDays
1166 {
1167 public:
1168
1169 };
1170
1171
1172
1173 /**
1174 @class wxDateSpan
1175 @wxheader{datetime.h}
1176
1177 This class is a "logical time span" and is useful for implementing program
1178 logic for such things as "add one month to the date" which, in general,
1179 doesn't mean to add 60*60*24*31 seconds to it, but to take the same date
1180 the next month (to understand that this is indeed different consider adding
1181 one month to Feb, 15 -- we want to get Mar, 15, of course).
1182
1183 When adding a month to the date, all lesser components (days, hours, ...)
1184 won't be changed unless the resulting date would be invalid: for example,
1185 Jan 31 + 1 month will be Feb 28, not (non-existing) Feb 31.
1186
1187 Because of this feature, adding and subtracting back again the same
1188 wxDateSpan will @b not, in general give back the original date: Feb 28 - 1
1189 month will be Jan 28, not Jan 31!
1190
1191 wxDateSpan objects can be either positive or negative. They may be
1192 multiplied by scalars which multiply all deltas by the scalar: i.e.
1193 2*(1 month and 1 day) is 2 months and 2 days. They can
1194 be added together and with wxDateTime or
1195 wxTimeSpan, but the type of result is different for each
1196 case.
1197
1198 Beware about weeks: if you specify both weeks and days, the total number of
1199 days added will be 7*weeks + days! See also GetTotalDays()
1200 function.
1201
1202 Equality operators are defined for wxDateSpans. Two datespans are equal if
1203 and only if they both give the same target date when added to @b every
1204 source date. Thus wxDateSpan::Months(1) is not equal to wxDateSpan::Days(30),
1205 because they don't give the same date when added to 1 Feb. But
1206 wxDateSpan::Days(14) is equal to wxDateSpan::Weeks(2)
1207
1208 Finally, notice that for adding hours, minutes and so on you don't need this
1209 class at all: wxTimeSpan will do the job because there
1210 are no subtleties associated with those (we don't support leap seconds).
1211
1212 @library{wxbase}
1213 @category{data}
1214
1215 @see @ref overview_wxdatetimeoverview "Date classes overview", wxDateTime
1216 */
1217 class wxDateSpan
1218 {
1219 public:
1220 /**
1221 Constructs the date span object for the given number of years, months, weeks
1222 and days. Note that the weeks and days add together if both are given.
1223 */
1224 wxDateSpan(int years = 0, int months = 0, int weeks = 0,
1225 int days = 0);
1226
1227 //@{
1228 /**
1229 Returns the sum of two date spans. The first version returns a new object, the
1230 second and third ones modify this object in place.
1231 */
1232 wxDateSpan Add(const wxDateSpan& other);
1233 const wxDateSpan& Add(const wxDateSpan& other);
1234 wxDateSpan operator+=(const wxDateSpan& other);
1235 //@}
1236
1237 /**
1238 Returns a date span object corresponding to one day.
1239
1240 @see Days()
1241 */
1242 static wxDateSpan Day();
1243
1244 /**
1245 Returns a date span object corresponding to the given number of days.
1246
1247 @see Day()
1248 */
1249 static wxDateSpan Days(int days);
1250
1251 /**
1252 Returns the number of days (only, that it not counting the weeks component!)
1253 in this date span.
1254
1255 @see GetTotalDays()
1256 */
1257 int GetDays() const;
1258
1259 /**
1260 Returns the number of the months (not counting the years) in this date span.
1261 */
1262 int GetMonths() const;
1263
1264 /**
1265 Returns the combined number of days in this date span, counting both weeks and
1266 days. It still doesn't take neither months nor years into the account.
1267
1268 @see GetWeeks(), GetDays()
1269 */
1270 int GetTotalDays() const;
1271
1272 /**
1273 Returns the number of weeks in this date span.
1274
1275 @see GetTotalDays()
1276 */
1277 int GetWeeks() const;
1278
1279 /**
1280 Returns the number of years in this date span.
1281 */
1282 int GetYears() const;
1283
1284 /**
1285 Returns a date span object corresponding to one month.
1286
1287 @see Months()
1288 */
1289 static wxDateSpan Month();
1290
1291 /**
1292 Returns a date span object corresponding to the given number of months.
1293
1294 @see Month()
1295 */
1296 static wxDateSpan Months(int mon);
1297
1298 //@{
1299 /**
1300 Returns the product of the date span by the specified @e factor. The
1301 product is computed by multiplying each of the components by the factor.
1302 The first version returns a new object, the second and third ones modify this
1303 object in place.
1304 */
1305 wxDateSpan Multiply(int factor);
1306 const wxDateSpan& Multiply(int factor);
1307 wxDateSpan operator*=(int factor);
1308 //@}
1309
1310 //@{
1311 /**
1312 Changes the sign of this date span.
1313
1314 @see Negate()
1315 */
1316 wxDateSpan Neg();
1317 wxDateSpan operator-();
1318 //@}
1319
1320 /**
1321 Returns the date span with the opposite sign.
1322
1323 @see Neg()
1324 */
1325 wxDateSpan Negate() const;
1326
1327 /**
1328 Sets the number of days (without modifying any other components) in this date
1329 span.
1330 */
1331 wxDateSpan& SetDays(int n);
1332
1333 /**
1334 Sets the number of months (without modifying any other components) in this
1335 date span.
1336 */
1337 wxDateSpan& SetMonths(int n);
1338
1339 /**
1340 Sets the number of weeks (without modifying any other components) in this date
1341 span.
1342 */
1343 wxDateSpan& SetWeeks(int n);
1344
1345 /**
1346 Sets the number of years (without modifying any other components) in this date
1347 span.
1348 */
1349 wxDateSpan& SetYears(int n);
1350
1351 //@{
1352 /**
1353 Returns the difference of two date spans. The first version returns a new
1354 object, the second and third ones modify this object in place.
1355 */
1356 wxDateSpan Subtract(const wxDateSpan& other);
1357 const wxDateSpan& Subtract(const wxDateSpan& other);
1358 wxDateSpan operator+=(const wxDateSpan& other);
1359 //@}
1360
1361 /**
1362 Returns a date span object corresponding to one week.
1363
1364 @see Weeks()
1365 */
1366 static wxDateSpan Week();
1367
1368 /**
1369 Returns a date span object corresponding to the given number of weeks.
1370
1371 @see Week()
1372 */
1373 static wxDateSpan Weeks(int weeks);
1374
1375 /**
1376 Returns a date span object corresponding to one year.
1377
1378 @see Years()
1379 */
1380 static wxDateSpan Year();
1381
1382 /**
1383 Returns a date span object corresponding to the given number of years.
1384
1385 @see Year()
1386 */
1387 static wxDateSpan Years(int years);
1388
1389 /**
1390 Returns @true if this date span is different from the other one.
1391 */
1392 bool operator!=(const wxDateSpan&) const;
1393
1394 /**
1395 Returns @true if this date span is equal to the other one. Two date spans
1396 are considered equal if and only if they have the same number of years and
1397 months and the same total number of days (counting both days and weeks).
1398 */
1399 bool operator==(const wxDateSpan&) const;
1400 };
1401
1402
1403
1404 /**
1405 @class wxTimeSpan
1406 @wxheader{datetime.h}
1407
1408 wxTimeSpan class represents a time interval.
1409
1410 @library{wxbase}
1411 @category{data}
1412
1413 @see @ref overview_wxdatetimeoverview "Date classes overview", wxDateTime
1414 */
1415 class wxTimeSpan
1416 {
1417 public:
1418 //@{
1419 /**
1420 Constructs timespan from separate values for each component, with the date
1421 set to 0. Hours are not restricted to 0..24 range, neither are
1422 minutes, seconds or milliseconds.
1423 */
1424 wxTimeSpan();
1425 wxTimeSpan(long hours, long min, long sec, long msec);
1426 //@}
1427
1428 /**
1429 Returns the absolute value of the timespan: does not modify the
1430 object.
1431 */
1432 wxTimeSpan Abs() const;
1433
1434 /**
1435 GetSeconds()
1436
1437 GetMinutes()
1438
1439 GetHours()
1440
1441 GetDays()
1442
1443 GetWeeks()
1444
1445 GetValue()
1446 */
1447
1448
1449 //@{
1450 /**
1451 Returns the sum of two timespans.
1452 */
1453 wxTimeSpan Add(const wxTimeSpan& diff);
1454 const wxTimeSpan& Add(const wxTimeSpan& diff);
1455 wxTimeSpan operator+=(const wxTimeSpan& diff);
1456 //@}
1457
1458 /**
1459 @ref ctor() wxTimeSpan
1460 */
1461
1462
1463 /**
1464 Returns the timespan for one day.
1465 */
1466 static wxTimespan Day();
1467
1468 /**
1469 Returns the timespan for the given number of days.
1470 */
1471 static wxTimespan Days(long days);
1472
1473 /**
1474 Returns the string containing the formatted representation of the time span.
1475 The following format specifiers are allowed after %:
1476
1477 H
1478
1479 number of @b Hours
1480
1481 M
1482
1483 number of @b Minutes
1484
1485 S
1486
1487 number of @b Seconds
1488
1489 l
1490
1491 number of mi@b lliseconds
1492
1493 D
1494
1495 number of @b Days
1496
1497 E
1498
1499 number of w@b Eeks
1500
1501 %
1502
1503 the percent character
1504
1505 Note that, for example, the number of hours in the description above is not
1506 well defined: it can be either the total number of hours (for example, for a
1507 time span of 50 hours this would be 50) or just the hour part of the time
1508 span, which would be 2 in this case as 50 hours is equal to 2 days and
1509 2 hours.
1510 wxTimeSpan resolves this ambiguity in the following way: if there had been,
1511 indeed, the @c %D format specified preceding the @c %H, then it is
1512 interpreted as 2. Otherwise, it is 50.
1513 The same applies to all other format specifiers: if they follow a specifier of
1514 larger unit, only the rest part is taken, otherwise the full value is used.
1515 */
1516 wxString Format(const wxString& = wxDefaultTimeSpanFormat) const;
1517
1518 /**
1519 Format()
1520 */
1521
1522
1523 /**
1524 Returns the difference in number of days.
1525 */
1526 int GetDays() const;
1527
1528 /**
1529 Returns the difference in number of hours.
1530 */
1531 int GetHours() const;
1532
1533 /**
1534 Returns the difference in number of milliseconds.
1535 */
1536 wxLongLong GetMilliseconds() const;
1537
1538 /**
1539 Returns the difference in number of minutes.
1540 */
1541 int GetMinutes() const;
1542
1543 /**
1544 Returns the difference in number of seconds.
1545 */
1546 wxLongLong GetSeconds() const;
1547
1548 /**
1549 Returns the internal representation of timespan.
1550 */
1551 wxLongLong GetValue() const;
1552
1553 /**
1554 Returns the difference in number of weeks.
1555 */
1556 int GetWeeks() const;
1557
1558 /**
1559 Returns the timespan for one hour.
1560 */
1561 static wxTimespan Hour();
1562
1563 /**
1564 Returns the timespan for the given number of hours.
1565 */
1566 static wxTimespan Hours(long hours);
1567
1568 /**
1569 Returns @true if two timespans are equal.
1570 */
1571 bool IsEqualTo(const wxTimeSpan& ts) const;
1572
1573 /**
1574 Compares two timespans: works with the absolute values, i.e. -2
1575 hours is longer than 1 hour. Also, it will return @false if
1576 the timespans are equal in absolute value.
1577 */
1578 bool IsLongerThan(const wxTimeSpan& ts) const;
1579
1580 /**
1581 Returns @true if the timespan is negative.
1582 */
1583 bool IsNegative() const;
1584
1585 /**
1586 Returns @true if the timespan is empty.
1587 */
1588 bool IsNull() const;
1589
1590 /**
1591 Returns @true if the timespan is positive.
1592 */
1593 bool IsPositive() const;
1594
1595 /**
1596 Compares two timespans: works with the absolute values, i.e. 1
1597 hour is shorter than -2 hours. Also, it will return @false if
1598 the timespans are equal in absolute value.
1599 */
1600 bool IsShorterThan(const wxTimeSpan& ts) const;
1601
1602 /**
1603 Returns the timespan for one millisecond.
1604 */
1605 static wxTimespan Millisecond();
1606
1607 /**
1608 Returns the timespan for the given number of milliseconds.
1609 */
1610 static wxTimespan Milliseconds(long ms);
1611
1612 /**
1613 Returns the timespan for one minute.
1614 */
1615 static wxTimespan Minute();
1616
1617 /**
1618 Returns the timespan for the given number of minutes.
1619 */
1620 static wxTimespan Minutes(long min);
1621
1622 //@{
1623 /**
1624 Multiplies timespan by a scalar.
1625 */
1626 wxTimeSpan Multiply(int n);
1627 const wxTimeSpan& Multiply(int n);
1628 wxTimeSpan operator*=(int n);
1629 //@}
1630
1631 //@{
1632 /**
1633 Negate the value of the timespan.
1634 */
1635 wxTimeSpan Neg();
1636 wxTimeSpan operator-();
1637 //@}
1638
1639 /**
1640 Returns timespan with inverted sign.
1641 */
1642 wxTimeSpan Negate() const;
1643
1644 /**
1645 Add()
1646
1647 Subtract()
1648
1649 Multiply()
1650
1651 Negate()
1652
1653 Neg()
1654
1655 Abs()
1656 */
1657
1658
1659 /**
1660 Returns the timespan for one second.
1661 */
1662 static wxTimespan Second();
1663
1664 /**
1665 Returns the timespan for the given number of seconds.
1666 */
1667 static wxTimespan Seconds(long sec);
1668
1669 /**
1670 Milliseconds()
1671
1672 Millisecond()
1673
1674 Seconds()
1675
1676 Second()
1677
1678 Minutes()
1679
1680 Minute()
1681
1682 Hours()
1683
1684 Hour()
1685
1686 Days()
1687
1688 Day()
1689
1690 Weeks()
1691
1692 Week()
1693 */
1694
1695
1696 //@{
1697 /**
1698 Returns the difference of two timespans.
1699 */
1700 wxTimeSpan Subtract(const wxTimeSpan& diff);
1701 const wxTimeSpan& Subtract(const wxTimeSpan& diff);
1702 wxTimeSpan operator-=(const wxTimeSpan& diff);
1703 //@}
1704
1705 /**
1706 IsNull()
1707
1708 IsPositive()
1709
1710 IsNegative()
1711
1712 IsEqualTo()
1713
1714 IsLongerThan()
1715
1716 IsShorterThan()
1717 */
1718
1719
1720 /**
1721 Returns the timespan for one week.
1722 */
1723 static wxTimespan Week();
1724
1725 /**
1726 Returns the timespan for the given number of weeks.
1727 */
1728 static wxTimespan Weeks(long weeks);
1729 };
1730
1731
1732
1733 /**
1734 @class wxDateTimeHolidayAuthority
1735 @wxheader{datetime.h}
1736
1737
1738 @library{wxbase}
1739 @category{FIXME}
1740 */
1741 class wxDateTimeHolidayAuthority
1742 {
1743 public:
1744
1745 };
1746