forked from grantrostig/cpp_by_example
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain.cpp
More file actions
35 lines (26 loc) · 903 Bytes
/
main.cpp
File metadata and controls
35 lines (26 loc) · 903 Bytes
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
#include "../../date/include/date/date.h"
#include <chrono>
#include <iostream>
using std::cout, std::endl;
int main() {
using namespace date;
// using namespace std::chrono;
std::chrono::time_point today1 =
date::floor<date::days>(std::chrono::system_clock::now());
date::year_month_day today1b{today1};
auto today1c_ymd = date::year_month_day{today1};
std::chrono::time_point today2 =
date::floor<std::chrono::seconds>(std::chrono::system_clock::now());
std::chrono::time_point today3 = std::chrono::system_clock::now();
constexpr date::year_month_day x1 = date::March / 22 / 2015;
unsigned int my_month{5};
date::year_month_day x2 =
date::year{2020} / date::month{my_month} / date::day{14};
cout << today1b << endl;
cout << today2 << endl;
cout << today3 << endl;
cout << x1 << endl;
cout << x2 << endl;
cout << "###" << endl;
return 0;
}