mirror of
https://github.com/HowardHinnant/date.git
synced 2025-08-04 21:24:26 +02:00
Updated Boost datetime Examples Translated (markdown)
@@ -480,13 +480,13 @@ main()
|
|||||||
```
|
```
|
||||||
<a name="Flight_Time_Example"></a>
|
<a name="Flight_Time_Example"></a>
|
||||||
### Flight Time Example
|
### Flight Time Example
|
||||||
|
```c++
|
||||||
|
#include "tz.h"
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "tz.h"
|
int
|
||||||
#include <iostream>
|
main()
|
||||||
|
{
|
||||||
int
|
|
||||||
main()
|
|
||||||
{
|
|
||||||
using namespace std::chrono;
|
using namespace std::chrono;
|
||||||
using namespace date;
|
using namespace date;
|
||||||
|
|
||||||
@@ -505,19 +505,19 @@ main()
|
|||||||
std::cout << "departure phx time: " << phx_departure << '\n';
|
std::cout << "departure phx time: " << phx_departure << '\n';
|
||||||
std::cout << "arrival phx time: " << phx_arrival << '\n';
|
std::cout << "arrival phx time: " << phx_arrival << '\n';
|
||||||
std::cout << "arrival nyc time: " << nyc_arrival << '\n';
|
std::cout << "arrival nyc time: " << nyc_arrival << '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Output:
|
|
||||||
//
|
|
||||||
// departure phx time: 2005-03-30 23:00
|
|
||||||
// arrival phx time: 2005-03-31 03:30 MST
|
|
||||||
// arrival nyc time: 2005-03-31 05:30 EST
|
|
||||||
//
|
|
||||||
// Note that boost states a nyc_arrival time of 2005-Mar-31 06:30:00 EDT
|
|
||||||
// because boost uses the current US daylightsavings rules as opposed to
|
|
||||||
// those that were in effect in 2005. This library varies its DST rules
|
|
||||||
// with the date.
|
|
||||||
|
|
||||||
|
// Output:
|
||||||
|
//
|
||||||
|
// departure phx time: 2005-03-30 23:00
|
||||||
|
// arrival phx time: 2005-03-31 03:30 MST
|
||||||
|
// arrival nyc time: 2005-03-31 05:30 EST
|
||||||
|
//
|
||||||
|
// Note that boost states a nyc_arrival time of 2005-Mar-31 06:30:00 EDT
|
||||||
|
// because boost uses the current US daylightsavings rules as opposed to
|
||||||
|
// those that were in effect in 2005. This library varies its DST rules
|
||||||
|
// with the date.
|
||||||
|
```
|
||||||
<a name="Seconds_Since_Epoch"></a>
|
<a name="Seconds_Since_Epoch"></a>
|
||||||
### Seconds Since Epoch
|
### Seconds Since Epoch
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user