mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-04-02 10:42:14 -04:00
byuu says: New update. Most of the work today went into eliminating hiro::Image from all objects in all ports, replacing with nall::image. That took an eternity. Changelog: - fixed crashing bug when loading games [thanks endrift!!] - toggling "show status bar" option adjusts window geometry (not supposed to recenter the window, though) - button sizes improved; icon-only button icons no longer being cut off
30 lines
765 B
C++
30 lines
765 B
C++
#pragma once
|
|
|
|
namespace nall {
|
|
|
|
auto string::date(time_t timestamp) -> string {
|
|
if(timestamp == 0) timestamp = ::time(nullptr);
|
|
tm* info = localtime(×tamp);
|
|
return {
|
|
nall::natural(1900 + info->tm_year, 4L), "-",
|
|
nall::natural(1 + info->tm_mon, 2L), "-",
|
|
nall::natural(info->tm_mday, 2L)
|
|
};
|
|
}
|
|
|
|
auto string::time(time_t timestamp) -> string {
|
|
if(timestamp == 0) timestamp = ::time(nullptr);
|
|
tm* info = localtime(×tamp);
|
|
return {
|
|
nall::natural(info->tm_hour, 2L), ":",
|
|
nall::natural(info->tm_min, 2L), ":",
|
|
nall::natural(info->tm_sec, 2L)
|
|
};
|
|
}
|
|
|
|
auto string::datetime(time_t timestamp) -> string {
|
|
if(timestamp == 0) timestamp = ::time(nullptr);
|
|
return {string::date(timestamp), " ", string::time(timestamp)};
|
|
}
|
|
|
|
}
|