Initial commit

This commit is contained in:
2020-05-01 11:25:56 +02:00
commit 4546808c73
33 changed files with 810 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
#include "Util.h"
#include <array>
#include <ctime>
namespace CameraRecorder {
namespace Recorder {
std::string GetDateTimeString(bool omitSeparator)
{
std::array<char, 17> buffer;
buffer.fill(0);
std::time_t t = std::time(nullptr);
std::tm* tm = std::localtime(&t);
if (omitSeparator)
strftime(buffer.data(), sizeof(buffer), "%Y%m%d%H%M%S", tm);
else
strftime(buffer.data(), sizeof(buffer), "%Y%m%d-%H%M%S", tm);
return buffer.data();
}
} // namespace Recorder
} // namespace CameraRecorder