mirror of
https://github.com/rvtr/GodMode9i.git
synced 2025-11-02 00:11:07 -04:00
* Improve dumping menu, add metadata dumping * Use `NONE` as fallback DS save instead of `UNK` Matches GM9 for my DSTT and バトル&ゲット:ポケモンタイピングDS * Fix metadata check for NAND save
40 lines
670 B
C++
40 lines
670 B
C++
#include "date.h"
|
|
|
|
#include "language.h"
|
|
|
|
#include <stdio.h>
|
|
#include <string>
|
|
#include <time.h>
|
|
|
|
/**
|
|
* Get the current time formatted for the top bar.
|
|
* @return std::string containing the time.
|
|
*/
|
|
std::string RetTime()
|
|
{
|
|
time_t raw;
|
|
time(&raw);
|
|
const struct tm *Time = localtime(&raw);
|
|
|
|
char tmp[8];
|
|
strftime(tmp, sizeof(tmp), STR_TIME_FORMAT.c_str(), Time);
|
|
|
|
return tmp;
|
|
}
|
|
|
|
/**
|
|
* Get the current time formatted as specified.
|
|
* @return std::string containing the time.
|
|
*/
|
|
std::string RetTime(const char *format)
|
|
{
|
|
time_t raw;
|
|
time(&raw);
|
|
const struct tm *Time = localtime(&raw);
|
|
|
|
char tmp[64];
|
|
strftime(tmp, sizeof(tmp), format, Time);
|
|
|
|
return tmp;
|
|
}
|