From e6d07f2e83d2e865e813d7d20df35193100edc24 Mon Sep 17 00:00:00 2001 From: White Date: Mon, 23 Mar 2015 14:20:59 +1030 Subject: [PATCH] Update to DateTime.UtcNow --- TShockAPI/SqlLog.cs | 6 +++--- TShockAPI/TextLog.cs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/TShockAPI/SqlLog.cs b/TShockAPI/SqlLog.cs index ad4950d6..ef0ceba7 100644 --- a/TShockAPI/SqlLog.cs +++ b/TShockAPI/SqlLog.cs @@ -248,7 +248,7 @@ namespace TShockAPI } _database.Query("INSERT INTO Logs (TimeStamp, Caller, LogLevel, Message) VALUES (@0, @1, @2, @3)", - DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture), caller, (int)level, message); + DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture), caller, (int)level, message); var success = true; while (_failures.Count > 0 && success) @@ -268,7 +268,7 @@ namespace TShockAPI caller = "TShock", logLevel = TraceLevel.Error, message = string.Format("SQL Log insert query failed: {0}", ex), - timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture) + timestamp = DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture) }); } @@ -285,7 +285,7 @@ namespace TShockAPI logLevel = level, message = message, caller = caller, - timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture) + timestamp = DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture) }); } diff --git a/TShockAPI/TextLog.cs b/TShockAPI/TextLog.cs index aef72b7a..bd256c75 100644 --- a/TShockAPI/TextLog.cs +++ b/TShockAPI/TextLog.cs @@ -212,7 +212,7 @@ namespace TShockAPI } var logEntry = string.Format("{0} - {1}: {2}: {3}", - DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture), + DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture), caller, level.ToString().ToUpper(), message); try { @@ -224,7 +224,7 @@ namespace TShockAPI ServerApi.LogWriter.PluginWriteLine(TShock.instance, logEntry, TraceLevel.Error); Console.WriteLine("Unable to write to log as log has been disposed."); Console.WriteLine("{0} - {1}: {2}: {3}", - DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture), + DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture), caller, level.ToString().ToUpper(), message); } }