mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-10 03:45:41 +00:00
🐞 Fix bug ensuring timestamp is UTC
This commit is contained in:
parent
10fea0b372
commit
a67fd274fa
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user