update util
This commit is contained in:
+11
-9
@@ -10,11 +10,22 @@ namespace SimApi.Helpers
|
|||||||
{
|
{
|
||||||
public static class SimApiUtil
|
public static class SimApiUtil
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 当前CST时间
|
||||||
|
/// </summary>
|
||||||
public static DateTime CstNow
|
public static DateTime CstNow
|
||||||
{
|
{
|
||||||
get => DateTime.UtcNow.AddHours(8);
|
get => DateTime.UtcNow.AddHours(8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 当前秒级时间戳
|
||||||
|
/// </summary>
|
||||||
|
public static double TimestampNow
|
||||||
|
{
|
||||||
|
get => (DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0)).TotalSeconds;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 检测手机号是否正确
|
/// 检测手机号是否正确
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -58,14 +69,5 @@ namespace SimApi.Helpers
|
|||||||
Encoder = JavaScriptEncoder.Create(UnicodeRanges.All)
|
Encoder = JavaScriptEncoder.Create(UnicodeRanges.All)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取 CST 当前时间
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static DateTime GetCstNow()
|
|
||||||
{
|
|
||||||
return CstNow;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user