Base: Move currentDateTimeString out of TimeInfo

currentDateTimeString does not have anything in common
with TimeInfo class, move it into Tools.
This commit is contained in:
Ladislav Michl
2024-01-21 17:14:47 +01:00
parent d60e7b9eae
commit 7b70d3fc6f
6 changed files with 14 additions and 12 deletions

View File

@@ -26,6 +26,7 @@
#include <sstream>
#include <locale>
#include <iostream>
#include <QDateTime>
#include <QElapsedTimer>
#endif
@@ -365,6 +366,14 @@ std::string Base::Tools::joinList(const std::vector<std::string>& vec, const std
return str.str();
}
std::string Base::Tools::currentDateTimeString()
{
return QDateTime::currentDateTime()
.toTimeSpec(Qt::OffsetFromUTC)
.toString(Qt::ISODate)
.toStdString();
}
// ----------------------------------------------------------------------------
using namespace Base;