This commit is contained in:
Putoo
2026-05-22 09:07:38 +08:00
parent 784bc66ef6
commit 0016ef7e83
22 changed files with 666 additions and 62 deletions

View File

@@ -0,0 +1,24 @@
namespace Application.Service.Pub;
public class TimeExtend
{
public static long GetTimeStampSeconds
{
get => Convert.ToInt64((DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0)).TotalSeconds);
}
public static long GetTimeStampMilliseconds
{
get => Convert.ToInt64((DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0)).TotalMilliseconds);
}
public static long GetTimeStampBySeconds(DateTime time)
{
return Convert.ToInt64((time - new DateTime(1970, 1, 1, 0, 0, 0, 0)).TotalSeconds);
}
public static long GetTimeStampByMilliseconds(DateTime time)
{
return Convert.ToInt64((time - new DateTime(1970, 1, 1, 0, 0, 0, 0)).TotalMilliseconds);
}
}