summaryrefslogtreecommitdiff
path: root/indra/newview/llfloater360capture.cpp
diff options
context:
space:
mode:
authorSignal Linden <signal@lindenlab.com>2024-04-29 16:29:23 -0700
committerGitHub <noreply@github.com>2024-04-29 16:29:23 -0700
commitc05c066894c7a49fb8a3dba553bac56216398934 (patch)
tree8283522498c4c54a2dae665f268b6180a5702f8d /indra/newview/llfloater360capture.cpp
parent0cceb13b5a5283078c31c88d864d700b49eeff7f (diff)
parent204b7ff6fb7544dd4210e125d275fd550f52f5c6 (diff)
Merge pull request #1344 from secondlife/signal/snapshot-time
Add timestamp to snapshot file names
Diffstat (limited to 'indra/newview/llfloater360capture.cpp')
-rw-r--r--indra/newview/llfloater360capture.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/indra/newview/llfloater360capture.cpp b/indra/newview/llfloater360capture.cpp
index 2c638fa959..9bc012d6f0 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"
@@ -862,15 +863,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