]> git.saurik.com Git - wxWidgets.git/blob - interface/datetime.h
47cb2d070566524c326bd34498edb7dc435647c3
[wxWidgets.git] / interface / datetime.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: datetime.h
3 // Purpose: documentation for wxDateTime class
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 @seealso
19 @ref overview_wxdatetimeoverview "Date classes overview", wxTimeSpan,
20 wxDateSpan, wxCalendarCtrl
21 */
22 class wxDateTime
23 {
24 public:
25 /**
26 Same as @ref setdate() Set
27 */
28 wxDateTime(wxDateTime_t day, Month month = Inv_Month,
29 int Inv_Year, wxDateTime_t hour = 0,
30 wxDateTime_t minute = 0,
31 wxDateTime_t second = 0,
32 wxDateTime_t millisec = 0);
33
34 /**
35 Here are the trivial accessors. Other functions, which might have to perform
36 some more complicated calculations to find the answer are under the
37 @ref overview_datetimecalculations "Calendar calculations" section.
38 IsValid()
39
40 GetTicks()
41
42 GetCentury()
43
44 GetYear()
45
46 GetMonth()
47
48 GetDay()
49
50 GetWeekDay()
51
52 GetHour()
53
54 GetMinute()
55
56 GetSecond()
57
58 GetMillisecond()
59
60 GetDayOfYear()
61
62 GetWeekOfYear()
63
64 GetWeekOfMonth()
65
66 GetYearDay()
67
68 IsWorkDay()
69
70 IsGregorianDate()
71
72 GetAsDOS()
73 */
74
75
76 //@{
77 /**
78 Adds the given date span to this object.
79 */
80 wxDateTime Add(const wxDateSpan& diff);
81 const wxDateTime& Add(const wxDateSpan& diff);
82 wxDateTime operator+=(const wxDateSpan& diff);
83 //@}
84
85 /**
86 Some degree of support for the date units used in astronomy and/or history is
87 provided. You can construct a wxDateTime object from a
88 @ref setjdn() JDN and you may also get its JDN,
89 @ref getmodifiedjuliandaynumber() MJD or
90 @ref getratadie() "Rata Die number" from it.
91 @ref wxdatetimejdn() "wxDateTime(double jdn)"
92
93 @ref setjdn() "Set(double jdn)"
94
95 GetJulianDayNumber()
96
97 GetJDN()
98
99 GetModifiedJulianDayNumber()
100
101 GetMJD()
102
103 GetRataDie()
104 */
105
106
107 /**
108 The functions in this section perform the basic calendar calculations, mostly
109 related to the week days. They allow to find the given week day in the
110 week with given number (either in the month or in the year) and so on.
111 All (non-const) functions in this section don't modify the time part of the
112 wxDateTime -- they only work with the date part of it.
113 SetToWeekDayInSameWeek()
114
115 GetWeekDayInSameWeek()
116
117 SetToNextWeekDay()
118
119 GetNextWeekDay()
120
121 SetToPrevWeekDay()
122
123 GetPrevWeekDay()
124
125 SetToWeekDay()
126
127 @ref wxDateTime::getweekday2 GetWeekDay
128
129 SetToLastWeekDay()
130
131 GetLastWeekDay()
132
133 SetToWeekOfYear()
134
135 SetToLastMonthDay()
136
137 GetLastMonthDay()
138
139 SetToYearDay()
140
141 GetYearDay()
142 */
143
144
145 /**
146 Constructors and various @c Set() methods are collected here. If you
147 construct a date object from separate values for day, month and year, you
148 should use IsValid() method to check that the
149 values were correct as constructors can not return an error code.
150 @ref wxdatetimedef() wxDateTime
151
152 @ref wxdatetimetimet() wxDateTime(time_t)
153
154 @ref wxdatetimetm() "wxDateTime(struct tm)"
155
156 @ref wxdatetimejdn() "wxDateTime(double jdn)"
157
158 @ref wxdatetimetime() "wxDateTime(h, m, s, ms)"
159
160 @ref wxdatetimedate() "wxDateTime(day, mon, year, h, m, s, ms)"
161
162 SetToCurrent()
163
164 @ref settimet() Set(time_t)
165
166 @ref settm() "Set(struct tm)"
167
168 @ref setjdn() "Set(double jdn)"
169
170 @ref settime() "Set(h, m, s, ms)"
171
172 @ref setdate() "Set(day, mon, year, h, m, s, ms)"
173
174 @ref setfromdos() "SetFromDOS(unsigned long ddt)"
175
176 ResetTime()
177
178 SetYear()
179
180 SetMonth()
181
182 @ref setdate() SetDay
183
184 SetHour()
185
186 SetMinute()
187
188 SetSecond()
189
190 SetMillisecond()
191
192 @ref operatoreqtimet() operator=(time_t)
193
194 @ref operatoreqtm() "operator=(struct tm)"
195 */
196
197
198 /**
199 Converts the year in absolute notation (i.e. a number which can be negative,
200 positive or zero) to the year in BC/AD notation. For the positive years,
201 nothing is done, but the year 0 is year 1 BC and so for other years there is a
202 difference of 1.
203 This function should be used like this:
204 */
205 static int ConvertYearToBC(int year);
206
207 /**
208 These functions carry out arithmetics on the wxDateTime
209 objects. As explained in the overview, either wxTimeSpan or wxDateSpan may be
210 added to wxDateTime, hence all functions are overloaded to accept both
211 arguments.
212 Also, both @c Add() and @c Subtract() have both const and non-const
213 version. The first one returns a new object which represents the
214 sum/difference of the original one with the argument while the second form
215 modifies the object to which it is applied. The operators -= and += are
216 defined to be equivalent to the second forms of these functions.
217 @ref addts() Add(wxTimeSpan)
218
219 @ref addds() Add(wxDateSpan)
220
221 @ref subtractts() Subtract(wxTimeSpan)
222
223 @ref subtractds() Subtract(wxDateSpan)
224
225 @ref subtractdt() Subtract(wxDateTime)
226
227 @ref addts() oparator+=(wxTimeSpan)
228
229 @ref addds() oparator+=(wxDateSpan)
230
231 @ref subtractts() oparator-=(wxTimeSpan)
232
233 @ref subtractds() oparator-=(wxDateSpan)
234 */
235
236
237 /**
238 There are several function to allow date comparison. To supplement them, a few
239 global operators , etc taking wxDateTime are defined.
240 IsEqualTo()
241
242 IsEarlierThan()
243
244 IsLaterThan()
245
246 IsStrictlyBetween()
247
248 IsBetween()
249
250 IsSameDate()
251
252 IsSameTime()
253
254 IsEqualUpTo()
255 */
256
257
258 /**
259 This function does the same as the standard ANSI C @c strftime(3) function.
260 Please see its description for the meaning of @a format parameter.
261 It also accepts a few wxWidgets-specific extensions: you can optionally specify
262 the width of the field to follow using @c printf(3)-like syntax and the
263 format specification @c %l can be used to get the number of milliseconds.
264
265 @see ParseFormat()
266 */
267 wxString Format(const wxChar* format = wxDefaultDateTimeFormat,
268 const TimeZone& tz = Local) const;
269
270 /**
271 Identical to calling Format() with @c "%x"
272 argument (which means 'preferred date representation for the current locale').
273 */
274 wxString FormatDate() const;
275
276 /**
277 Returns the combined date-time representation in the ISO 8601 format
278 (YYYY-MM-DDTHH:MM:SS). The @a sep parameter default value produces the
279 result exactly corresponding to the ISO standard, but it can also be useful to
280 use a space as seprator if a more human-readable combined date-time
281 representation is needed.
282
283 @see FormatISODate(), FormatISOTime(),
284 ParseISOCombined()
285 */
286 wxString FormatISOCombined(char sep = 'T') const;
287
288 /**
289 This function returns the date representation in the ISO 8601 format
290 (YYYY-MM-DD).
291 */
292 wxString FormatISODate() const;
293
294 /**
295 This function returns the time representation in the ISO 8601 format
296 (HH:MM:SS).
297 */
298 wxString FormatISOTime() const;
299
300 /**
301 Identical to calling Format() with @c "%X"
302 argument (which means 'preferred time representation for the current locale').
303 */
304 wxString FormatTime() const;
305
306 /**
307 Transform the date from the given time zone to the local one. If @a noDST is
308 @true, no DST adjustments will be made.
309 Returns the date in the local time zone.
310 */
311 wxDateTime FromTimezone(const TimeZone& tz,
312 bool noDST = false) const;
313
314 /**
315 Returns the translations of the strings @c AM and @c PM used for time
316 formatting for the current locale. Either of the pointers may be @NULL if
317 the corresponding value is not needed.
318 */
319 static void GetAmPmStrings(wxString* am, wxString* pm);
320
321 /**
322 Returns the date and time in
323 DOS
324 format.
325 */
326 unsigned long GetAsDOS() const;
327
328 /**
329 Get the beginning of DST for the given country in the given year (current one
330 by default). This function suffers from limitations described in
331 @ref overview_tdatedst "DST overview".
332
333 @see GetEndDST()
334 */
335 static wxDateTime GetBeginDST(int year = Inv_Year,
336 Country country = Country_Default);
337
338 /**
339 Returns the century of this date.
340 */
341 int GetCentury(const TimeZone& tz = Local) const;
342
343 /**
344 Returns the current default country. The default country is used for DST
345 calculations, for example.
346
347 @see SetCountry()
348 */
349 static Country GetCountry();
350
351 /**
352 Get the current month in given calendar (only Gregorian is currently supported).
353 */
354 static Month GetCurrentMonth(Calendar cal = Gregorian);
355
356 /**
357 Get the current year in given calendar (only Gregorian is currently supported).
358 */
359 static int GetCurrentYear(Calendar cal = Gregorian);
360
361 /**
362 Returns the object having the same date component as this one but time of
363 00:00:00.
364 This function is new since wxWidgets version 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 wxDateTime_t 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 wxDateTime_t 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 wxDateTime_t 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 wxDateTime_t GetMillisecond(const TimeZone& tz = Local) const;
432
433 /**
434 Returns the minute in the given timezone (local one by default).
435 */
436 wxDateTime_t 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 wxDateTime_t 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(wxDateTime_t yday) 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(wxDateTime_t day);
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(wxDateTime_t hour);
934
935 /**
936 Sets the millisecond without changing other date components.
937 */
938 wxDateTime SetMillisecond(wxDateTime_t millisecond);
939
940 /**
941 Sets the minute without changing other date components.
942 */
943 wxDateTime SetMinute(wxDateTime_t minute);
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(wxDateTime_t second);
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(wxDateTime_t yday);
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 @class wxDateTimeWorkDays
1158 @wxheader{datetime.h}
1159
1160
1161 @library{wxbase}
1162 @category{FIXME}
1163 */
1164 class wxDateTimeWorkDays
1165 {
1166 public:
1167
1168 };
1169
1170
1171 /**
1172 @class wxDateSpan
1173 @wxheader{datetime.h}
1174
1175 This class is a "logical time span" and is useful for implementing program
1176 logic for such things as "add one month to the date" which, in general,
1177 doesn't mean to add 60*60*24*31 seconds to it, but to take the same date
1178 the next month (to understand that this is indeed different consider adding
1179 one month to Feb, 15 -- we want to get Mar, 15, of course).
1180
1181 When adding a month to the date, all lesser components (days, hours, ...)
1182 won't be changed unless the resulting date would be invalid: for example,
1183 Jan 31 + 1 month will be Feb 28, not (non-existing) Feb 31.
1184
1185 Because of this feature, adding and subtracting back again the same
1186 wxDateSpan will @b not, in general give back the original date: Feb 28 - 1
1187 month will be Jan 28, not Jan 31!
1188
1189 wxDateSpan objects can be either positive or negative. They may be
1190 multiplied by scalars which multiply all deltas by the scalar: i.e.
1191 2*(1 month and 1 day) is 2 months and 2 days. They can
1192 be added together and with wxDateTime or
1193 wxTimeSpan, but the type of result is different for each
1194 case.
1195
1196 Beware about weeks: if you specify both weeks and days, the total number of
1197 days added will be 7*weeks + days! See also GetTotalDays()
1198 function.
1199
1200 Equality operators are defined for wxDateSpans. Two datespans are equal if
1201 and only if they both give the same target date when added to @b every
1202 source date. Thus wxDateSpan::Months(1) is not equal to wxDateSpan::Days(30),
1203 because they don't give the same date when added to 1 Feb. But
1204 wxDateSpan::Days(14) is equal to wxDateSpan::Weeks(2)
1205
1206 Finally, notice that for adding hours, minutes and so on you don't need this
1207 class at all: wxTimeSpan will do the job because there
1208 are no subtleties associated with those (we don't support leap seconds).
1209
1210 @library{wxbase}
1211 @category{data}
1212
1213 @seealso
1214 @ref overview_wxdatetimeoverview "Date classes overview", wxDateTime
1215 */
1216 class wxDateSpan
1217 {
1218 public:
1219 /**
1220 Constructs the date span object for the given number of years, months, weeks
1221 and days. Note that the weeks and days add together if both are given.
1222 */
1223 wxDateSpan(int years = 0, int months = 0, int weeks = 0,
1224 int days = 0);
1225
1226 //@{
1227 /**
1228 Returns the sum of two date spans. The first version returns a new object, the
1229 second and third ones modify this object in place.
1230 */
1231 wxDateSpan Add(const wxDateSpan& other);
1232 const wxDateSpan& Add(const wxDateSpan& other);
1233 wxDateSpan operator+=(const wxDateSpan& other);
1234 //@}
1235
1236 /**
1237 Returns a date span object corresponding to one day.
1238
1239 @see Days()
1240 */
1241 static wxDateSpan Day();
1242
1243 /**
1244 Returns a date span object corresponding to the given number of days.
1245
1246 @see Day()
1247 */
1248 static wxDateSpan Days(int days);
1249
1250 /**
1251 Returns the number of days (only, that it not counting the weeks component!)
1252 in this date span.
1253
1254 @see GetTotalDays()
1255 */
1256 int GetDays() const;
1257
1258 /**
1259 Returns the number of the months (not counting the years) in this date span.
1260 */
1261 int GetMonths() const;
1262
1263 /**
1264 Returns the combined number of days in this date span, counting both weeks and
1265 days. It still doesn't take neither months nor years into the account.
1266
1267 @see GetWeeks(), GetDays()
1268 */
1269 int GetTotalDays() const;
1270
1271 /**
1272 Returns the number of weeks in this date span.
1273
1274 @see GetTotalDays()
1275 */
1276 int GetWeeks() const;
1277
1278 /**
1279 Returns the number of years in this date span.
1280 */
1281 int GetYears() const;
1282
1283 /**
1284 Returns a date span object corresponding to one month.
1285
1286 @see Months()
1287 */
1288 static wxDateSpan Month();
1289
1290 /**
1291 Returns a date span object corresponding to the given number of months.
1292
1293 @see Month()
1294 */
1295 static wxDateSpan Months(int mon);
1296
1297 //@{
1298 /**
1299 Returns the product of the date span by the specified @e factor. The
1300 product is computed by multiplying each of the components by the factor.
1301 The first version returns a new object, the second and third ones modify this
1302 object in place.
1303 */
1304 wxDateSpan Multiply(int factor);
1305 const wxDateSpan& Multiply(int factor);
1306 wxDateSpan operator*=(int factor);
1307 //@}
1308
1309 //@{
1310 /**
1311 Changes the sign of this date span.
1312
1313 @see Negate()
1314 */
1315 wxDateSpan Neg();
1316 wxDateSpan operator-();
1317 //@}
1318
1319 /**
1320 Returns the date span with the opposite sign.
1321
1322 @see Neg()
1323 */
1324 wxDateSpan Negate() const;
1325
1326 /**
1327 Sets the number of days (without modifying any other components) in this date
1328 span.
1329 */
1330 wxDateSpan SetDays(int n);
1331
1332 /**
1333 Sets the number of months (without modifying any other components) in this
1334 date span.
1335 */
1336 wxDateSpan SetMonths(int n);
1337
1338 /**
1339 Sets the number of weeks (without modifying any other components) in this date
1340 span.
1341 */
1342 wxDateSpan SetWeeks(int n);
1343
1344 /**
1345 Sets the number of years (without modifying any other components) in this date
1346 span.
1347 */
1348 wxDateSpan SetYears(int n);
1349
1350 //@{
1351 /**
1352 Returns the difference of two date spans. The first version returns a new
1353 object, the second and third ones modify this object in place.
1354 */
1355 wxDateSpan Subtract(const wxDateSpan& other);
1356 const wxDateSpan& Subtract(const wxDateSpan& other);
1357 wxDateSpan operator+=(const wxDateSpan& other);
1358 //@}
1359
1360 /**
1361 Returns a date span object corresponding to one week.
1362
1363 @see Weeks()
1364 */
1365 static wxDateSpan Week();
1366
1367 /**
1368 Returns a date span object corresponding to the given number of weeks.
1369
1370 @see Week()
1371 */
1372 static wxDateSpan Weeks(int weeks);
1373
1374 /**
1375 Returns a date span object corresponding to one year.
1376
1377 @see Years()
1378 */
1379 static wxDateSpan Year();
1380
1381 /**
1382 Returns a date span object corresponding to the given number of years.
1383
1384 @see Year()
1385 */
1386 static wxDateSpan Years(int years);
1387
1388 /**
1389 Returns @true if this date span is different from the other one.
1390 */
1391 bool operator!=(wxDateSpan& other) const;
1392
1393 /**
1394 Returns @true if this date span is equal to the other one. Two date spans
1395 are considered equal if and only if they have the same number of years and
1396 months and the same total number of days (counting both days and weeks).
1397 */
1398 bool operator==(wxDateSpan& other) const;
1399 };
1400
1401
1402 /**
1403 @class wxTimeSpan
1404 @wxheader{datetime.h}
1405
1406 wxTimeSpan class represents a time interval.
1407
1408 @library{wxbase}
1409 @category{data}
1410
1411 @seealso
1412 @ref overview_wxdatetimeoverview "Date classes overview", wxDateTime
1413 */
1414 class wxTimeSpan
1415 {
1416 public:
1417 //@{
1418 /**
1419 Constructs timespan from separate values for each component, with the date
1420 set to 0. Hours are not restricted to 0..24 range, neither are
1421 minutes, seconds or milliseconds.
1422 */
1423 wxTimeSpan();
1424 wxTimeSpan(long hours, long min, long sec, long msec);
1425 //@}
1426
1427 /**
1428 Returns the absolute value of the timespan: does not modify the
1429 object.
1430 */
1431 wxTimeSpan Abs() const;
1432
1433 /**
1434 GetSeconds()
1435
1436 GetMinutes()
1437
1438 GetHours()
1439
1440 GetDays()
1441
1442 GetWeeks()
1443
1444 GetValue()
1445 */
1446
1447
1448 //@{
1449 /**
1450 Returns the sum of two timespans.
1451 */
1452 wxTimeSpan Add(const wxTimeSpan& diff);
1453 const wxTimeSpan& Add(const wxTimeSpan& diff);
1454 wxTimeSpan operator+=(const wxTimeSpan& diff);
1455 //@}
1456
1457 /**
1458 @ref ctor() wxTimeSpan
1459 */
1460
1461
1462 /**
1463 Returns the timespan for one day.
1464 */
1465 static wxTimespan Day();
1466
1467 /**
1468 Returns the timespan for the given number of days.
1469 */
1470 static wxTimespan Days(long days);
1471
1472 /**
1473 Returns the string containing the formatted representation of the time span.
1474 The following format specifiers are allowed after %:
1475
1476 H
1477
1478 number of @b Hours
1479
1480 M
1481
1482 number of @b Minutes
1483
1484 S
1485
1486 number of @b Seconds
1487
1488 l
1489
1490 number of mi@b lliseconds
1491
1492 D
1493
1494 number of @b Days
1495
1496 E
1497
1498 number of w@b Eeks
1499
1500 %
1501
1502 the percent character
1503
1504 Note that, for example, the number of hours in the description above is not
1505 well defined: it can be either the total number of hours (for example, for a
1506 time span of 50 hours this would be 50) or just the hour part of the time
1507 span, which would be 2 in this case as 50 hours is equal to 2 days and
1508 2 hours.
1509 wxTimeSpan resolves this ambiguity in the following way: if there had been,
1510 indeed, the @c %D format specified preceding the @c %H, then it is
1511 interpreted as 2. Otherwise, it is 50.
1512 The same applies to all other format specifiers: if they follow a specifier of
1513 larger unit, only the rest part is taken, otherwise the full value is used.
1514 */
1515 wxString Format(const wxChar* format = wxDefaultTimeSpanFormat);
1516
1517 /**
1518 Format()
1519 */
1520
1521
1522 /**
1523 Returns the difference in number of days.
1524 */
1525 int GetDays() const;
1526
1527 /**
1528 Returns the difference in number of hours.
1529 */
1530 int GetHours() const;
1531
1532 /**
1533 Returns the difference in number of milliseconds.
1534 */
1535 wxLongLong GetMilliseconds() const;
1536
1537 /**
1538 Returns the difference in number of minutes.
1539 */
1540 int GetMinutes() const;
1541
1542 /**
1543 Returns the difference in number of seconds.
1544 */
1545 wxLongLong GetSeconds() const;
1546
1547 /**
1548 Returns the internal representation of timespan.
1549 */
1550 wxLongLong GetValue() const;
1551
1552 /**
1553 Returns the difference in number of weeks.
1554 */
1555 int GetWeeks() const;
1556
1557 /**
1558 Returns the timespan for one hour.
1559 */
1560 static wxTimespan Hour();
1561
1562 /**
1563 Returns the timespan for the given number of hours.
1564 */
1565 static wxTimespan Hours(long hours);
1566
1567 /**
1568 Returns @true if two timespans are equal.
1569 */
1570 bool IsEqualTo(const wxTimeSpan& ts) const;
1571
1572 /**
1573 Compares two timespans: works with the absolute values, i.e. -2
1574 hours is longer than 1 hour. Also, it will return @false if
1575 the timespans are equal in absolute value.
1576 */
1577 bool IsLongerThan(const wxTimeSpan& ts) const;
1578
1579 /**
1580 Returns @true if the timespan is negative.
1581 */
1582 bool IsNegative() const;
1583
1584 /**
1585 Returns @true if the timespan is empty.
1586 */
1587 bool IsNull() const;
1588
1589 /**
1590 Returns @true if the timespan is positive.
1591 */
1592 bool IsPositive() const;
1593
1594 /**
1595 Compares two timespans: works with the absolute values, i.e. 1
1596 hour is shorter than -2 hours. Also, it will return @false if
1597 the timespans are equal in absolute value.
1598 */
1599 bool IsShorterThan(const wxTimeSpan& ts) const;
1600
1601 /**
1602 Returns the timespan for one millisecond.
1603 */
1604 static wxTimespan Millisecond();
1605
1606 /**
1607 Returns the timespan for the given number of milliseconds.
1608 */
1609 static wxTimespan Milliseconds(long ms);
1610
1611 /**
1612 Returns the timespan for one minute.
1613 */
1614 static wxTimespan Minute();
1615
1616 /**
1617 Returns the timespan for the given number of minutes.
1618 */
1619 static wxTimespan Minutes(long min);
1620
1621 //@{
1622 /**
1623 Multiplies timespan by a scalar.
1624 */
1625 wxTimeSpan Multiply(int n);
1626 const wxTimeSpan& Multiply(int n);
1627 wxTimeSpan operator*=(int n);
1628 //@}
1629
1630 //@{
1631 /**
1632 Negate the value of the timespan.
1633 */
1634 wxTimeSpan Neg();
1635 wxTimeSpan operator-();
1636 //@}
1637
1638 /**
1639 Returns timespan with inverted sign.
1640 */
1641 wxTimeSpan Negate() const;
1642
1643 /**
1644 Add()
1645
1646 Subtract()
1647
1648 Multiply()
1649
1650 Negate()
1651
1652 Neg()
1653
1654 Abs()
1655 */
1656
1657
1658 /**
1659 Returns the timespan for one second.
1660 */
1661 static wxTimespan Second();
1662
1663 /**
1664 Returns the timespan for the given number of seconds.
1665 */
1666 static wxTimespan Seconds(long sec);
1667
1668 /**
1669 Milliseconds()
1670
1671 Millisecond()
1672
1673 Seconds()
1674
1675 Second()
1676
1677 Minutes()
1678
1679 Minute()
1680
1681 Hours()
1682
1683 Hour()
1684
1685 Days()
1686
1687 Day()
1688
1689 Weeks()
1690
1691 Week()
1692 */
1693
1694
1695 //@{
1696 /**
1697 Returns the difference of two timespans.
1698 */
1699 wxTimeSpan Subtract(const wxTimeSpan& diff);
1700 const wxTimeSpan& Subtract(const wxTimeSpan& diff);
1701 wxTimeSpan operator-=(const wxTimeSpan& diff);
1702 //@}
1703
1704 /**
1705 IsNull()
1706
1707 IsPositive()
1708
1709 IsNegative()
1710
1711 IsEqualTo()
1712
1713 IsLongerThan()
1714
1715 IsShorterThan()
1716 */
1717
1718
1719 /**
1720 Returns the timespan for one week.
1721 */
1722 static wxTimespan Week();
1723
1724 /**
1725 Returns the timespan for the given number of weeks.
1726 */
1727 static wxTimespan Weeks(long weeks);
1728 };
1729
1730
1731 /**
1732 @class wxDateTimeHolidayAuthority
1733 @wxheader{datetime.h}
1734
1735
1736 @library{wxbase}
1737 @category{FIXME}
1738 */
1739 class wxDateTimeHolidayAuthority
1740 {
1741 public:
1742
1743 };