diff options
author | krzys-h <krzys_h@interia.pl> | 2013-12-27 22:28:25 +0100 |
---|---|---|
committer | krzys-h <krzys_h@interia.pl> | 2013-12-27 22:28:25 +0100 |
commit | 0ff7e55b3343fbca959fb11236a009fb3790b652 (patch) | |
tree | 196b9cec76ac2dea901c680af10bc306841f6b1f /src/common/misc.cpp | |
parent | 1b7389367897b858781790f2ada63203b4035ada (diff) | |
download | colobot-0ff7e55b3343fbca959fb11236a009fb3790b652.tar.gz colobot-0ff7e55b3343fbca959fb11236a009fb3790b652.tar.bz2 colobot-0ff7e55b3343fbca959fb11236a009fb3790b652.zip |
Fix for #177 - save list sorting
Diffstat (limited to 'src/common/misc.cpp')
-rw-r--r-- | src/common/misc.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/common/misc.cpp b/src/common/misc.cpp index b96abca..65689e6 100644 --- a/src/common/misc.cpp +++ b/src/common/misc.cpp @@ -230,6 +230,23 @@ void TimeToAscii(time_t time, char *buffer) #endif*/ } +// Converting time to string. + +void TimeToAsciiClean(time_t time, char *buffer) +{ + struct tm when; + int year; + + when = *localtime(&time); + year = when.tm_year+1900; + if ( year < 2000 ) year -= 1900; + else year -= 2000; + + sprintf(buffer, "%.2d%.2d%.2d%.2d%.2d", + year, when.tm_mon+1, when.tm_mday, + when.tm_hour, when.tm_min); +} + // Copy a list of numbered files into the temporary folder. bool CopyFileListToTemp(char* filename, int* list, int total) |