1 | // Standard C headers
|
---|
2 | #include <stdio.h>
|
---|
3 |
|
---|
4 | // Haiku headers
|
---|
5 | // This is a private header, so may not work like this.
|
---|
6 | // Copy it to local folder and change <> to "".
|
---|
7 | #include <HttpTime.h>
|
---|
8 |
|
---|
9 | using BPrivate::BHttpTime;
|
---|
10 |
|
---|
11 | int main(int argc, char **argv) {
|
---|
12 |
|
---|
13 | BString sun = "Sun, 04-Jun-2017 00:00:00 GMT";
|
---|
14 | BString mon = "Mon, 05-Jun-2017 00:00:00 GMT";
|
---|
15 | BString tue = "Tue, 06-Jun-2017 00:00:00 GMT";
|
---|
16 | BString wed = "Wed, 07-Jun-2017 00:00:00 GMT";
|
---|
17 | BString thu = "Thu, 08-Jun-2017 00:00:00 GMT";
|
---|
18 | BString fri = "Fri, 09-Jun-2017 00:00:00 GMT";
|
---|
19 | BString sat = "Sat, 10-Jun-2017 00:00:00 GMT";
|
---|
20 | BDateTime sunDate = BHttpTime(sun).Parse();
|
---|
21 | BDateTime monDate = BHttpTime(mon).Parse();
|
---|
22 | BDateTime tueDate = BHttpTime(tue).Parse();
|
---|
23 | BDateTime wedDate = BHttpTime(wed).Parse();
|
---|
24 | BDateTime satDate = BHttpTime(sat).Parse();
|
---|
25 | BDateTime thuDate = BHttpTime(thu).Parse();
|
---|
26 | BDateTime friDate = BHttpTime(fri).Parse();
|
---|
27 | printf("Sunday: %s, back to string: %s\n", sun.String(), BHttpTime(sunDate).ToString().String());
|
---|
28 | printf("Monday: %s, back to string: %s\n", mon.String(), BHttpTime(monDate).ToString().String());
|
---|
29 | printf("Tuesday: %s, back to string: %s\n", tue.String(), BHttpTime(tueDate).ToString().String());
|
---|
30 | printf("Wednesday: %s, back to string: %s\n", wed.String(), BHttpTime(wedDate).ToString().String());
|
---|
31 | printf("Thursday: %s, back to string: %s\n", thu.String(), BHttpTime(thuDate).ToString().String());
|
---|
32 | printf("Friday: %s, back to string: %s\n", fri.String(), BHttpTime(friDate).ToString().String());
|
---|
33 | printf("Saturday: %s, back to string: %s\n", sat.String(), BHttpTime(satDate).ToString().String());
|
---|
34 |
|
---|
35 | return 0;
|
---|
36 |
|
---|
37 | }
|
---|