Last active
July 25, 2018 09:59
-
-
Save dmthuc/c6b96271cf1fc00444c663f703f42609 to your computer and use it in GitHub Desktop.
boost::gregorian::date usage:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <fstream> | |
#include <cassert> | |
#include "boost/date_time/gregorian/gregorian.hpp" | |
using namespace std; | |
using namespace boost::gregorian; | |
int main() { | |
date d(from_undelimited_string(string{"20180101"})); | |
date d2(from_simple_string("2018-01-01")); | |
string ext = to_iso_extended_string(d); | |
assert(ext == "2018-01-01"); | |
for (day_iterator d{start_date}; d <= end_date; ++d) { | |
ofstream ofs(argv[3] + to_iso_extended_string(*d), std::ofstream::out); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment