diff options
author | Mattias Ellert <mattias.ellert@physics.uu.se> | 2019-10-19 16:28:11 (GMT) |
---|---|---|
committer | Mattias Ellert <mattias.ellert@physics.uu.se> | 2019-10-19 16:28:11 (GMT) |
commit | c993785c8cae4712cd6fd34004c02041a128d7c7 (patch) | |
tree | cdb09edd20777725b2f8620c860a123ee8646205 /src/util.cpp | |
parent | d0d748aee7fdd0469479d7feff16f337322a2175 (diff) | |
download | Doxygen-c993785c8cae4712cd6fd34004c02041a128d7c7.zip Doxygen-c993785c8cae4712cd6fd34004c02041a128d7c7.tar.gz Doxygen-c993785c8cae4712cd6fd34004c02041a128d7c7.tar.bz2 |
Let $year support SOURCE_DATE_EPOCH
Diffstat (limited to 'src/util.cpp')
-rw-r--r-- | src/util.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/util.cpp b/src/util.cpp index e1e9fb5..770c834 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -2590,7 +2590,7 @@ QCString fileToString(const char *name,bool filter,bool isSourceCode) return ""; } -QCString dateToString(bool includeTime) +static QDateTime getCurrentDateTime() { QDateTime current = QDateTime::currentDateTime(); QCString sourceDateEpoch = portable_getenv("SOURCE_DATE_EPOCH"); @@ -2622,6 +2622,12 @@ QCString dateToString(bool includeTime) current.setTimeUtc_t((ulong)epoch); // TODO: add support for 64bit epoch value } } + return current; +} + +QCString dateToString(bool includeTime) +{ + const QDateTime current = getCurrentDateTime(); return theTranslator->trDateTime(current.date().year(), current.date().month(), current.date().day(), @@ -2634,9 +2640,9 @@ QCString dateToString(bool includeTime) QCString yearToString() { - const QDate &d=QDate::currentDate(); + const QDateTime current = getCurrentDateTime(); QCString result; - result.sprintf("%d", d.year()); + result.sprintf("%d", current.date().year()); return result; } |