Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Movie: Use std::put_time in GetRTCDisplay() #5567

Merged
merged 1 commit into from Jun 7, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 8 additions & 6 deletions Source/Core/Core/Movie.cpp
Expand Up @@ -7,10 +7,12 @@
#include <algorithm>
#include <array>
#include <cctype>
#include <iomanip>
#include <iterator>
#include <mbedtls/config.h>
#include <mbedtls/md.h>
#include <mutex>
#include <sstream>
#include <thread>
#include <utility>
#include <variant>
Expand Down Expand Up @@ -187,13 +189,13 @@ std::string GetInputDisplay()
// NOTE: GPU Thread
std::string GetRTCDisplay()
{
time_t current_time =
ExpansionInterface::CEXIIPL::GetEmulatedTime(ExpansionInterface::CEXIIPL::UNIX_EPOCH);
tm* gm_time = gmtime(&current_time);
char buffer[256];
strftime(buffer, sizeof(buffer), "Date/Time: %c\n", gm_time);
using ExpansionInterface::CEXIIPL;

const time_t current_time = CEXIIPL::GetEmulatedTime(CEXIIPL::UNIX_EPOCH);
const tm* const gm_time = gmtime(&current_time);

std::stringstream format_time;
format_time << buffer;
format_time << std::put_time(gm_time, "Date/Time: %c\n");
return format_time.str();
}

Expand Down