We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 25ce127 + a19d7b2 commit 04c3463Copy full SHA for 04c3463
src/objects/metadata.cxx
@@ -51,17 +51,16 @@ std::string generate_random_hash() {
51
52
std::string current_time_stamp(bool file_name) {
53
auto t_ = std::time(nullptr);
54
- auto tm_ = *std::localtime(&t_);
55
-
56
- std::ostringstream oss_;
+ auto tm_ = std::localtime(&t_);
+ char buffer_[80];
57
58
if (!file_name) {
59
- oss_ << std::put_time(&tm_, "%Y-%m-%d %H:%M:%S");
+ strftime(buffer_, sizeof(buffer_), "%Y-%m-%d %H:%M:%S", tm_);
60
} else {
61
- oss_ << std::put_time(&tm_, "%Y%m%d-%H%M%S");
+ strftime(buffer_, sizeof(buffer_), "%Y%m%d-%H%M%S", tm_);
62
}
63
64
- return oss_.str();
+ return std::string(buffer_);
65
66
67
std::string remove_local_from_root(const std::string &root){
0 commit comments