mirror of
https://github.com/hch12907/orbum.git
synced 2024-05-20 05:00:48 -04:00
11 lines
295 B
C++
11 lines
295 B
C++
#include "Datetime.hpp"
|
|
|
|
std::string datetime_fmt(const char* format, const std::time_t datetime)
|
|
{
|
|
char buf[100];
|
|
|
|
if (!std::strftime(buf, sizeof(buf), format, std::localtime(&datetime)))
|
|
throw std::runtime_error("Failed to print current time");
|
|
|
|
return std::string(buf);
|
|
} |