diff options
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) |