submodule对gitea不管用,所以直接拉了一份拉格兰
This commit is contained in:
10
Lagrange.Core/Lagrange.OneBot/Utility/DateTimeExt.cs
Normal file
10
Lagrange.Core/Lagrange.OneBot/Utility/DateTimeExt.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace Lagrange.OneBot.Utility;
|
||||
|
||||
public static class DateTimeExt
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static uint ToTimestamp(this DateTime time) =>
|
||||
(uint)(time - new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds;
|
||||
}
|
||||
Reference in New Issue
Block a user