diff options
-rw-r--r-- | Help/command/string.rst | 2 | ||||
-rw-r--r-- | Help/release/dev/timestamp.rst | 5 | ||||
-rw-r--r-- | Source/cmTimestamp.cxx | 2 | ||||
-rw-r--r-- | Tests/RunCMake/string/Timestamp-stderr.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/string/Timestamp.cmake | 2 |
5 files changed, 11 insertions, 2 deletions
diff --git a/Help/command/string.rst b/Help/command/string.rst index ba4a412..fb3893f 100644 --- a/Help/command/string.rst +++ b/Help/command/string.rst @@ -324,6 +324,7 @@ specifiers: %j The day of the current year (001-366). %m The month of the current year (01-12). %b Abbreviated month name (e.g. Oct). + %B Full month name (e.g. October). %M The minute of the current hour (00-59). %s Seconds since midnight (UTC) 1-Jan-1970 (UNIX time). %S The second of the current minute. @@ -331,6 +332,7 @@ specifiers: %U The week number of the current year (00-53). %w The day of the current week. 0 is Sunday. (0-6) %a Abbreviated weekday name (e.g. Fri). + %A Full weekday name (e.g. Friday). %y The last two digits of the current year (00-99) %Y The current year. diff --git a/Help/release/dev/timestamp.rst b/Help/release/dev/timestamp.rst new file mode 100644 index 0000000..e40009e --- /dev/null +++ b/Help/release/dev/timestamp.rst @@ -0,0 +1,5 @@ +timestamp +--------- + +* The :command:`string(TIMESTAMP)` command now supports ``%A`` + for full weekday name and ``%B`` for full month name. diff --git a/Source/cmTimestamp.cxx b/Source/cmTimestamp.cxx index 4dea24c..9fb79d9 100644 --- a/Source/cmTimestamp.cxx +++ b/Source/cmTimestamp.cxx @@ -123,7 +123,9 @@ std::string cmTimestamp::AddTimestampComponent(char flag, switch (flag) { case 'a': + case 'A': case 'b': + case 'B': case 'd': case 'H': case 'I': diff --git a/Tests/RunCMake/string/Timestamp-stderr.txt b/Tests/RunCMake/string/Timestamp-stderr.txt index 653974c..cd4dcb3 100644 --- a/Tests/RunCMake/string/Timestamp-stderr.txt +++ b/Tests/RunCMake/string/Timestamp-stderr.txt @@ -1 +1 @@ -RESULT=2005-08-07 23:19:49 Sun Aug 05 day=219 wd=0 week=32 %I=11 epoch=1123456789 +RESULT=2005-08-07 23:19:49 Sunday=Sun August=Aug 05 day=219 wd=0 week=32 %I=11 epoch=1123456789 diff --git a/Tests/RunCMake/string/Timestamp.cmake b/Tests/RunCMake/string/Timestamp.cmake index d242039..cba258d 100644 --- a/Tests/RunCMake/string/Timestamp.cmake +++ b/Tests/RunCMake/string/Timestamp.cmake @@ -1,3 +1,3 @@ set(ENV{SOURCE_DATE_EPOCH} "1123456789") -string(TIMESTAMP RESULT "%Y-%m-%d %H:%M:%S %a %b %y day=%j wd=%w week=%U %%I=%I epoch=%s" UTC) +string(TIMESTAMP RESULT "%Y-%m-%d %H:%M:%S %A=%a %B=%b %y day=%j wd=%w week=%U %%I=%I epoch=%s" UTC) message("RESULT=${RESULT}") |