RSTools 3.1.0
Versatile C++20 utility library
Loading...
Searching...
No Matches
DateTime.hpp File Reference
#include <chrono>
#include <cstdint>
#include <string>
#include <string_view>

Go to the source code of this file.

Namespaces

namespace  RST
 Root namespace of RSTools.
 
namespace  RST::Time
 Stopwatch, frame timing and date formatting.
 

Enumerations

enum class  RST::Time::TimeZone : std::uint8_t { RST::Time::Local , RST::Time::Utc }
 Time zone used to format dates. More...
 

Functions

std::string RST::Time::formatTime (std::chrono::system_clock::time_point time, std::string_view format="%Y-%m-%d %H:%M:%S", TimeZone zone=TimeZone::Local)
 Formats time with std::strftime codes, such as Y-m-d H:M:S; returns an empty string on failure.
 
std::string RST::Time::formatNow (std::string_view format="%Y-%m-%d %H:%M:%S", TimeZone zone=TimeZone::Local)
 Formats the current time; see formatTime().