Created
May 11, 2020 07:26
-
-
Save insaneyilin/e7472be392aa5d8b26b200ede8b90aa4 to your computer and use it in GitHub Desktop.
format unix timestamp to string
This file contains hidden or 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 <sstream> | |
#include <iomanip> | |
#include <string> | |
// e.g. 1584773265.928826 | |
std::stringstream oss; | |
oss << std::setfill('0') << std::setw(17) << std::fixed | |
<< std::setprecision(6) << timestamp << ".png"; | |
std::string filename = oss.str(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment