🐞 Fix bug ensuring timestamp is UTC

This commit is contained in:
Oliver Booth 2019-11-16 20:18:19 +00:00
parent 10fea0b372
commit a67fd274fa
No known key found for this signature in database
GPG Key ID: 4B0992B2602C3778
1 changed files with 1 additions and 1 deletions

View File

@ -141,7 +141,7 @@
/// <returns>Returns a Unix timestamp representing the provided <see cref="DateTime"/>.</returns> /// <returns>Returns a Unix timestamp representing the provided <see cref="DateTime"/>.</returns>
public static long ToUnixTimeStamp(this DateTime time, bool useMillis = false) public static long ToUnixTimeStamp(this DateTime time, bool useMillis = false)
{ {
DateTimeOffset offset = time; DateTimeOffset offset = time.ToUniversalTime();
return useMillis ? offset.ToUnixTimeSeconds() : offset.ToUnixTimeMilliseconds(); return useMillis ? offset.ToUnixTimeSeconds() : offset.ToUnixTimeMilliseconds();
} }