Updated Boost datetime Examples Translated (markdown)

Howard Hinnant
2019-05-15 10:49:24 -04:00
parent 6bf81ed9d8
commit aa767596d9

@@ -28,7 +28,7 @@ look if ported to this library.
<a name="Dates_as_Strings"></a> <a name="Dates_as_Strings"></a>
### Dates as String ### Dates as String
```c++ ```c++
#include "date.h" #include "date/date.h"
#include <cassert> #include <cassert>
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
@@ -59,8 +59,9 @@ main()
// Let's send in month 25 by accident and create an exception // Let's send in month 25 by accident and create an exception
in.str("20012509"); // 2001-??-09 in.str("20012509"); // 2001-??-09
in.clear();
in.exceptions(std::ios::failbit); in.exceptions(std::ios::failbit);
cout << "An expected exception is next:\n"; cout << "An expected exception is next:" << endl;
in >> parse("%Y%m%d", d); in >> parse("%Y%m%d", d);
cout << "oh oh, you shouldn't reach this line:\n"; cout << "oh oh, you shouldn't reach this line:\n";
} }