Common: Add utility function that wraps localtime_s() or localtime_t().

This commit is contained in:
Admiral H. Curtiss
2024-02-18 04:40:25 +01:00
parent 982ad93355
commit 52410813f2
4 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,13 @@
// Copyright 2024 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <ctime>
#include <optional>
namespace Common
{
// Threadsafe and error-checking variant of std::localtime()
std::optional<std::tm> Localtime(std::time_t time);
} // Namespace Common