diff options
author | Bennett Goble <signal@lindenlab.com> | 2024-04-27 10:49:31 -0700 |
---|---|---|
committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2025-03-11 22:25:33 +0200 |
commit | 851039cf4ed0de89b3a79b1e12483879a120576c (patch) | |
tree | 4ae54d8cdaf7998a7dd4610f3b6d800cc39d0414 /indra/newview/llfloater360capture.cpp | |
parent | 89a87fbf81353e9143750bf5389236a45afc9f9a (diff) |
Add timestamp to snapshot file names
This changeset adds a timestamp in the format of "YYYY-MM-DD_HHSS" to
snapshot filenames. This is useful for understanding when a snapshot was
taken, chronologically ordering files, and is less confusing than the
current method of adding a number to the snapshot name, as it does not
result in interleaving of old and new snapshots inside a directory.
Diffstat (limited to 'indra/newview/llfloater360capture.cpp')
-rw-r--r-- | indra/newview/llfloater360capture.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/indra/newview/llfloater360capture.cpp b/indra/newview/llfloater360capture.cpp index 49999495c0..25970f8a08 100644 --- a/indra/newview/llfloater360capture.cpp +++ b/indra/newview/llfloater360capture.cpp @@ -33,6 +33,7 @@ #include "llagentui.h" #include "llbase64.h" #include "llcallbacklist.h" +#include "lldate.h" #include "llenvironment.h" #include "llimagejpeg.h" #include "llmediactrl.h" @@ -879,15 +880,7 @@ const std::string LLFloater360Capture::generate_proposed_filename() filename << "_"; // add in the current HH-MM-SS (with leading 0's) so users can easily save many shots in same folder - std::time_t cur_epoch = std::time(nullptr); - std::tm* tm_time = std::localtime(&cur_epoch); - filename << std::setfill('0') << std::setw(4) << (tm_time->tm_year + 1900); - filename << std::setfill('0') << std::setw(2) << (tm_time->tm_mon + 1); - filename << std::setfill('0') << std::setw(2) << tm_time->tm_mday; - filename << "_"; - filename << std::setfill('0') << std::setw(2) << tm_time->tm_hour; - filename << std::setfill('0') << std::setw(2) << tm_time->tm_min; - filename << std::setfill('0') << std::setw(2) << tm_time->tm_sec; + filename << LLDate::now().toLocalDateString("%Y%m%d_%H%M%S"); // the unusual way we save the output image (originates in the // embedded browser and not the C++ code) means that the system |