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