1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-23 00:38:47 +00:00

🐞 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

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();
} }