summaryrefslogtreecommitdiffstats
path: root/src/common/misc.cpp
diff options
context:
space:
mode:
authorDidier Raboud <odyx@debian.org>2014-07-02 11:33:47 +0200
committerDidier Raboud <odyx@debian.org>2014-07-02 11:33:47 +0200
commit2e136acd34c45e5e6d105cabf91c67e5865c38fe (patch)
tree8561603160cce0b41ba31250539a22d37a2951de /src/common/misc.cpp
parent562be6fe765d7742f7c38fbd82f8cc26369e238b (diff)
parentd9fee8b2adad613cf8c10d153cd5cd7b261b7863 (diff)
downloadcolobot-2e136acd34c45e5e6d105cabf91c67e5865c38fe.tar.gz
colobot-2e136acd34c45e5e6d105cabf91c67e5865c38fe.tar.bz2
colobot-2e136acd34c45e5e6d105cabf91c67e5865c38fe.zip
Merge tag 'colobot-gold-0.1.3-alpha' into debian
Diffstat (limited to 'src/common/misc.cpp')
-rw-r--r--src/common/misc.cpp33
1 files changed, 16 insertions, 17 deletions
diff --git a/src/common/misc.cpp b/src/common/misc.cpp
index b96abca..92c3e9a 100644
--- a/src/common/misc.cpp
+++ b/src/common/misc.cpp
@@ -192,18 +192,6 @@ void TimeToAscii(time_t time, char *buffer)
year = when.tm_year+1900;
if ( year < 2000 ) year -= 1900;
else year -= 2000;
-/* TODO
-#if _FRENCH
- sprintf(buffer, "%.2d.%.2d.%.2d %.2d:%.2d",
- when.tm_mday, when.tm_mon+1, year,
- when.tm_hour, when.tm_min);
-#endif
-#if _GERMAN | _WG
- sprintf(buffer, "%.2d.%.2d.%.2d %.2d:%.2d",
- when.tm_mday, when.tm_mon+1, year,
- when.tm_hour, when.tm_min);
-#endif
-#if _ENGLISH*/
char format[10];
int hour;
@@ -222,12 +210,23 @@ void TimeToAscii(time_t time, char *buffer)
sprintf(buffer, "%.2d.%.2d.%.2d %.2d:%.2d %s",
when.tm_mon+1, when.tm_mday, year,
hour, when.tm_min, format);
-/*#endif
-#if _POLISH
- sprintf(buffer, "%.2d.%.2d.%.2d %.2d:%.2d",
- when.tm_mday, when.tm_mon+1, year,
+}
+
+// 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);
-#endif*/
}
// Copy a list of numbered files into the temporary folder.