diff --git a/Boost-datetime-Examples-Translated.md b/Boost-datetime-Examples-Translated.md index 1a9fcc5..57e8372 100644 --- a/Boost-datetime-Examples-Translated.md +++ b/Boost-datetime-Examples-Translated.md @@ -432,23 +432,23 @@ main() ``` ### Time Periods +```c++ +#include "date.h" +#include - #include "date.h" - #include - - 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. +} +``` ### Simple Time Zones