mirror of
https://github.com/HowardHinnant/date.git
synced 2025-08-04 21:24:26 +02:00
Updated Boost datetime Examples Translated (markdown)
@@ -432,23 +432,23 @@ main()
|
||||
```
|
||||
<a name="Time_Periods"></a>
|
||||
### Time Periods
|
||||
```c++
|
||||
#include "date.h"
|
||||
#include <iostream>
|
||||
|
||||
#include "date.h"
|
||||
#include <iostream>
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace std::chrono;
|
||||
using namespace date;
|
||||
auto d = sys_days(2002_y/feb/1); // an arbitrary date
|
||||
auto t = d + 3h + 5s; //an arbitray time on that day
|
||||
if (d <= t && t < d + days{1})
|
||||
std::cout << d << " contains " << t << '\n';
|
||||
// Time periods not part of this library but can be built
|
||||
// from a pair of time_points.
|
||||
}
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace std::chrono;
|
||||
using namespace date;
|
||||
auto d = sys_days{2002_y/feb/1}; // an arbitrary date
|
||||
auto t = d + 3h + 5s; //an arbitray time on that day
|
||||
if (d <= t && t < d + days{1})
|
||||
std::cout << d << " contains " << t << '\n';
|
||||
// Time periods not part of this library but can be built
|
||||
// from a pair of time_points.
|
||||
}
|
||||
```
|
||||
<a name="Simple_Time_Zones"></a>
|
||||
### Simple Time Zones
|
||||
|
||||
|
Reference in New Issue
Block a user