mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +02:00
extra function: getFormattedDateTime
This commit is contained in:
@@ -10,6 +10,8 @@
|
||||
#include "StdInc.h"
|
||||
#include "CMapInfo.h"
|
||||
|
||||
#include <vstd/DateUtils.h>
|
||||
|
||||
#include "../filesystem/ResourceID.h"
|
||||
#include "../StartInfo.h"
|
||||
#include "../GameConstants.h"
|
||||
@@ -62,12 +64,7 @@ void CMapInfo::saveInit(const ResourceID & file)
|
||||
fullFileURI = boost::filesystem::canonical(*CResourceHandler::get()->getResourceName(file)).string();
|
||||
countPlayers();
|
||||
std::time_t time = boost::filesystem::last_write_time(*CResourceHandler::get()->getResourceName(file));
|
||||
|
||||
std::tm tm = *std::localtime(&time);
|
||||
std::stringstream s;
|
||||
s.imbue(std::locale(""));
|
||||
s << std::put_time(&tm, "%x %X");
|
||||
date = s.str();
|
||||
date = vstd::getFormattedDateTime(time);
|
||||
|
||||
// We absolutely not need this data for lobby and server will read it from save
|
||||
// FIXME: actually we don't want them in CMapHeader!
|
||||
|
Reference in New Issue
Block a user