aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/commands_export.cpp
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2017-04-21 18:05:45 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2017-04-21 18:06:53 -0700
commit817e2f47af792e4aee93d68356ba50d3549f8a51 (patch)
treedefc38b8f0e49bc9859c7d0f61c00c8a003374dc /toolsrc/src/commands_export.cpp
parent156432a4383f8da33c29ef9e17ce477b03141058 (diff)
downloadvcpkg-817e2f47af792e4aee93d68356ba50d3549f8a51.tar.gz
vcpkg-817e2f47af792e4aee93d68356ba50d3549f8a51.zip
`export`: Shorten the date format
Diffstat (limited to 'toolsrc/src/commands_export.cpp')
-rw-r--r--toolsrc/src/commands_export.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/toolsrc/src/commands_export.cpp b/toolsrc/src/commands_export.cpp
index 135b7eff2..a459aadd5 100644
--- a/toolsrc/src/commands_export.cpp
+++ b/toolsrc/src/commands_export.cpp
@@ -102,11 +102,11 @@ namespace vcpkg::Commands::Export
{
const tm date_time = System::get_current_date_time();
- // Format is: YYYY-mm-dd_HH-MM-SS
- // 19 characters + 1 null terminating character will be written for a total of 20 chars
- char mbstr[20];
- const size_t bytes_written = std::strftime(mbstr, sizeof(mbstr), "%Y-%m-%d_%H-%M-%S", &date_time);
- Checks::check_exit(VCPKG_LINE_INFO, bytes_written == 19, "Expected 19 bytes to be written, but %u were written", bytes_written);
+ // Format is: YYYYmmdd-HHMMSS
+ // 15 characters + 1 null terminating character will be written for a total of 16 chars
+ char mbstr[16];
+ const size_t bytes_written = std::strftime(mbstr, sizeof(mbstr), "%Y%m%d-%H%M%S", &date_time);
+ Checks::check_exit(VCPKG_LINE_INFO, bytes_written == 15, "Expected 15 bytes to be written, but %u were written", bytes_written);
const std::string date_time_as_string(mbstr);
return ("exported-" + date_time_as_string);
}