diff options
Diffstat (limited to 'Source/cmTimestamp.cxx')
-rw-r--r-- | Source/cmTimestamp.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Source/cmTimestamp.cxx b/Source/cmTimestamp.cxx index 0915986..a9be729 100644 --- a/Source/cmTimestamp.cxx +++ b/Source/cmTimestamp.cxx @@ -6,6 +6,7 @@ #include <sstream> #include <stdlib.h> +#include "cmStringAlgorithms.h" #include "cmSystemTools.h" std::string cmTimestamp::CurrentTime(const std::string& formatString, @@ -131,8 +132,7 @@ std::string cmTimestamp::AddTimestampComponent(char flag, struct tm& timeStruct, const time_t timeT) const { - std::string formatString = "%"; - formatString += flag; + std::string formatString = cmStrCat('%', flag); switch (flag) { case 'a': @@ -168,9 +168,7 @@ std::string cmTimestamp::AddTimestampComponent(char flag, return std::string(); } - std::ostringstream ss; - ss << static_cast<long int>(difftime(timeT, unixEpoch)); - return ss.str(); + return std::to_string(static_cast<long int>(difftime(timeT, unixEpoch))); } default: { return formatString; |