From 7b0f0a9245d62fdb2eff83fbb5c07a5a1d7cc336 Mon Sep 17 00:00:00 2001 From: xRain Date: Wed, 18 May 2022 20:15:25 +0800 Subject: [PATCH] add cst time util --- Helpers/SimApiUtil.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Helpers/SimApiUtil.cs b/Helpers/SimApiUtil.cs index 5045c56..b766d15 100644 --- a/Helpers/SimApiUtil.cs +++ b/Helpers/SimApiUtil.cs @@ -1,4 +1,5 @@ -using System.Security.Cryptography; +using System; +using System.Security.Cryptography; using System.Text; using System.Text.Encodings.Web; using System.Text.Json; @@ -52,5 +53,14 @@ namespace SimApi.Helpers Encoder = JavaScriptEncoder.Create(UnicodeRanges.All) }); } + + /// + /// 获取 CST 当前时间 + /// + /// + public static DateTime GetCstNow() + { + return DateTime.UtcNow.AddHours(8); + } } } \ No newline at end of file