From 298aa5d189b759bcafddfa7cd0517d4fc35ca59f Mon Sep 17 00:00:00 2001 From: HookedBehemoth Date: Wed, 6 May 2020 17:07:10 +0200 Subject: [PATCH] convert timestamp to date time --- source/main.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/main.cpp b/source/main.cpp index d61ad0f..2183ab1 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -220,7 +220,15 @@ Result Capture() { /* I don't care if any of this fails. */ FsTimeStampRaw timestamp; if (R_SUCCEEDED(fsFsGetFileTimeStampRaw(&fs, path_buffer, ×tamp))) { - std::snprintf(b_path_buffer, FS_MAX_PATH, "/Bitmaps/%ld.bmp", timestamp.created); + time_t ts = timestamp.created; + tm *t = localtime(&ts); + std::snprintf(b_path_buffer, FS_MAX_PATH, "/Bitmaps/%d-%02d-%02d_%02d-%02d-%02d.bmp", + t->tm_year + 1900, + t->tm_mon + 1, + t->tm_mday, + t->tm_hour, + t->tm_min, + t->tm_sec); fsFsRenameFile(&fs, path_buffer, b_path_buffer); }