mirror of
https://github.com/HowardHinnant/date.git
synced 2025-08-05 21:54:27 +02:00
Updated Boost datetime Examples Translated (markdown)
@@ -252,7 +252,7 @@ main()
|
||||
```
|
||||
<a name="Print_Holidays"></a>
|
||||
### Print Holidays
|
||||
|
||||
```c++
|
||||
#include "date.h"
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
@@ -276,19 +276,19 @@ main()
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace date;
|
||||
|
||||
std::cout << "Enter Year: ";
|
||||
int y;
|
||||
std::cin >> y;
|
||||
year y;
|
||||
std::cin >> parse("%Y", y);
|
||||
|
||||
using namespace date;
|
||||
//define a collection of holidays fixed by month and day
|
||||
auto holidays = generate_holidays(year{y});
|
||||
auto holidays = generate_holidays(y);
|
||||
for (const auto& d : holidays)
|
||||
std::cout << d << " [" << weekday(d) << "]\n";
|
||||
std::cout << d << " [" << weekday{d} << "]\n";
|
||||
std::cout << "Number Holidays: " << holidays.size() << '\n';
|
||||
}
|
||||
|
||||
```
|
||||
<a name="Print_Month"></a>
|
||||
### Print Month
|
||||
|
||||
|
Reference in New Issue
Block a user