]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/gettime.h
Pass clang-format on various cpp/header files (#5559)
[dragonfireclient.git] / src / gettime.h
index 2a6a211b88b3176850a719a486f7d3f3fb1fdb17..b2f09a7bb9ee7882aa35b3eee969a9b21a670c6a 100644 (file)
@@ -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 <time.h>
 #include <string>
+#include <time.h>
 
 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