mirror of
https://github.com/MikuLeaks/MikuSB.git
synced 2026-06-04 10:03:57 +00:00
15 lines
326 B
C#
15 lines
326 B
C#
|
|
namespace MikuSB.Util;
|
|
|
|
|
|
public static class DateTimeExtensions
|
|
{
|
|
private static readonly DateTime UnixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
|
|
|
public static long ToUnixTimestampMilliseconds(this DateTime dateTime)
|
|
{
|
|
return (long)(dateTime - UnixEpoch).TotalMilliseconds;
|
|
}
|
|
|
|
}
|