From 0ff7e55b3343fbca959fb11236a009fb3790b652 Mon Sep 17 00:00:00 2001 From: krzys-h Date: Fri, 27 Dec 2013 22:28:25 +0100 Subject: Fix for #177 - save list sorting --- src/common/misc.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/common/misc.cpp') 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) -- cgit v1.2.3-1-g7c22