Updated Boost datetime Examples Translated (markdown)

HowardHinnant
2015-09-05 16:08:37 -04:00
parent af9c6e51db
commit fc1b05ca73

@@ -421,7 +421,8 @@ look if ported to this library.
// eastern timezone is utc-5
zone = locate_zone("America/New_York");
auto t1 = day_point(2001_y/dec/31) + 19h + 0s; // 5 hours b/f midnight NY time
// 5 hours b/f midnight NY time
auto t1 = day_point(2001_y/dec/31) + 19h + 0s;
std::cout << "\nUTC <--> New York while DST is NOT active (5 hours)\n";
auto t2 = zone->to_sys(t1);
std::cout << t1 << " in New York is " << t2 << " UTC time\n";
@@ -429,7 +430,8 @@ look if ported to this library.
auto t3 = zone->to_local(t2).first; // back should be the same
std::cout << t2 << " UTC is " << t3 << " New York time\n\n";
auto t4 = day_point(2002_y/may/31) + 20h + 0s; // 4 hours b/f midnight NY time
// 4 hours b/f midnight NY time
auto t4 = day_point(2002_y/may/31) + 20h + 0s;
std::cout << "UTC <--> New York while DST is active (4 hours)\n";
auto t5 = zone->to_sys(t4);
std::cout << t4 << " in New York is " << t5 << " UTC time\n";