X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fgettime.h;h=b2f09a7bb9ee7882aa35b3eee969a9b21a670c6a;hb=91a9382c25328075d1a27593b22b0a75863951e1;hp=2a6a211b88b3176850a719a486f7d3f3fb1fdb17;hpb=d1ccc64e1ecfd00df36d2b8a8b3420b70434fefd;p=dragonfireclient.git diff --git a/src/gettime.h b/src/gettime.h index 2a6a211b8..b2f09a7bb 100644 --- a/src/gettime.h +++ b/src/gettime.h @@ -31,7 +31,8 @@ with this program; if not, write to the Free Software Foundation, Inc., Normal build: main.cpp Server build: servermain.cpp */ -enum TimePrecision { +enum TimePrecision +{ PRECISION_SECONDS = 0, PRECISION_MILLI, PRECISION_MICRO, @@ -45,8 +46,8 @@ extern u32 getTime(TimePrecision prec); Timestamp stuff */ -#include #include +#include inline std::string getTimestamp() { @@ -54,10 +55,9 @@ inline std::string getTimestamp() // This is not really thread-safe but it won't break anything // except its own output, so just go with it. struct tm *tm = localtime(&t); - char cs[20]; - strftime(cs, 20, "%H:%M:%S", tm); + char cs[20]; // YYYY-MM-DD HH:MM:SS + '\0' + strftime(cs, 20, "%Y-%m-%d %H:%M:%S", tm); return cs; } - #endif