diff --git a/doc/qtcreator.qdoc b/doc/qtcreator.qdoc index 36ccf8ef418..28ddd5be1b5 100644 --- a/doc/qtcreator.qdoc +++ b/doc/qtcreator.qdoc @@ -7324,6 +7324,8 @@ \list 1 \o \c %YEAR%: Year + \o \c %MONTH%: Month + \o \c %DAY%: Day of the month \o \c %DATE%: Date \o \c %USER%: User name \o \c %FILENAME%: File name diff --git a/src/plugins/cpptools/cppfilesettingspage.cpp b/src/plugins/cpptools/cppfilesettingspage.cpp index 6355c3e3f2d..2076aaca2ad 100644 --- a/src/plugins/cpptools/cppfilesettingspage.cpp +++ b/src/plugins/cpptools/cppfilesettingspage.cpp @@ -116,6 +116,14 @@ static bool keyWordReplacement(const QString &keyWord, *value = QString::number(QDate::currentDate().year()); return true; } + if (keyWord == QLatin1String("%MONTH%")) { + *value = QString::number(QDate::currentDate().month()); + return true; + } + if (keyWord == QLatin1String("%DAY%")) { + *value = QString::number(QDate::currentDate().day()); + return true; + } if (keyWord == QLatin1String("%CLASS%")) { *value = className; return true;