diff --git a/Boost-datetime-Examples-Translated.md b/Boost-datetime-Examples-Translated.md
index db6c961..6a98d69 100644
--- a/Boost-datetime-Examples-Translated.md
+++ b/Boost-datetime-Examples-Translated.md
@@ -516,7 +516,6 @@ an example using the IANA timezone database see the [Local to UTC Conversion](#L
###Flight Time Example
- #include "date.h"
#include "tz.h"
#include
@@ -527,27 +526,20 @@ an example using the IANA timezone database see the [Local to UTC Conversion](#L
using namespace date;
// set up some timezones for creating and adjusting local times
- auto nyc_tz = locate_zone("America/New_York");
auto phx_tz = locate_zone("America/Phoenix");
+ auto nyc_tz = locate_zone("America/New_York");
// local departure time in phoenix is 11 pm on March 30 2005
// (ny changes to dst on apr 3 at 2 am)
- auto phx_departure = sys_days(2005_y/mar/30) + 23h + 0min;
- auto utc_departure = phx_tz->to_sys(phx_departure);
+ auto phx_departure = make_zoned(phx_tz, local_days{2005_y/mar/30} + 23h);
- auto flight_length = 4h + 30min;
- auto utc_arrival = utc_departure + flight_length;
-
- auto phx_arrival = phx_tz->to_local(utc_arrival);
- auto nyc_arrival = nyc_tz->to_local(utc_arrival);
+ // flight is 4 hours, 30 minutes
+ auto phx_arrival = make_zoned(phx_tz, phx_departure.get_sys_time() + 4h + 30min);
+ auto nyc_arrival = make_zoned(nyc_tz, phx_arrival);
std::cout << "departure phx time: " << phx_departure << '\n';
- std::cout << "arrival phx time: "
- << floor(phx_arrival)
- << ' ' << phx_arrival.second << '\n';
- std::cout << "arrival nyc time: "
- << floor(nyc_arrival)
- << ' ' << nyc_arrival.second << '\n';
+ std::cout << "arrival phx time: " << phx_arrival << '\n';
+ std::cout << "arrival nyc time: " << nyc_arrival << '\n';
}
// Output: