Updated Boost datetime Examples Translated (markdown)

HowardHinnant
2015-09-05 16:07:12 -04:00
parent 3a0ccdf0be
commit af9c6e51db

@@ -386,14 +386,16 @@ look if ported to this library.
using namespace std::chrono;
using namespace date;
// get the current time from the clock -- one second resolution
auto now = floor<seconds>(current_zone()->to_local(system_clock::now()).first);
auto now = floor<seconds>(current_zone()->
to_local(system_clock::now()).first);
// Get the date part out of the time
auto today = floor<days>(now);
auto tomorrow = today + days{1}; // midnight
for (auto i = now; i < tomorrow; i += 1h)
std::cout << i << '\n';
auto remaining = tomorrow - now;
std::cout << "Time left until midnight: " << make_time(remaining) << '\n';
std::cout << "Time left until midnight: "
<< make_time(remaining) << '\n';
}
<a name="Local_to_UTC_Conversion"></a>