diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2021-02-05 19:37:19 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2021-02-05 19:37:19 (GMT) |
commit | f4c0ef8d600844973fed21be5be522bf4dc4c319 (patch) | |
tree | b690e5fc6e2cda6153200258a2ba2ffc1074e891 /src/rtfgen.cpp | |
parent | 4dcf39fb5b61d633ac3982011ace355ec1b27abc (diff) | |
download | Doxygen-f4c0ef8d600844973fed21be5be522bf4dc4c319.zip Doxygen-f4c0ef8d600844973fed21be5be522bf4dc4c319.tar.gz Doxygen-f4c0ef8d600844973fed21be5be522bf4dc4c319.tar.bz2 |
Refactoring: qtools cleanup + remove QDateTime use from rtfgen.cpp
Diffstat (limited to 'src/rtfgen.cpp')
-rw-r--r-- | src/rtfgen.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index f04fb38..65a5258 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -17,6 +17,8 @@ * */ +#include <chrono> +#include <ctime> #include <stdlib.h> #include <qdir.h> @@ -48,16 +50,20 @@ #include "filename.h" #include "namespacedef.h" + //#define DBG_RTF(x) x; #define DBG_RTF(x) static QCString dateToRTFDateString() { - const QDateTime &d = QDateTime::currentDateTime(); + auto now = std::chrono::system_clock::now(); + auto time = std::chrono::system_clock::to_time_t(now); + auto tm = *localtime(&time); + QCString result; result.sprintf("\\yr%d\\mo%d\\dy%d\\hr%d\\min%d\\sec%d", - d.date().year(), d.date().month(), d.date().day(), - d.time().hour(),d.time().minute(),d.time().second()); + tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday, + tm.tm_hour, tm.tm_min, tm.tm_sec); return result; } |