初始化
This commit is contained in:
18
Commonlib/Tools_EX.cs
Normal file
18
Commonlib/Tools_EX.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Commonlib
|
||||
{
|
||||
public class Tools_EX
|
||||
{
|
||||
public DateTime GetSpecificZoneNowDate(string zoneName = "China Standard Time")
|
||||
{
|
||||
var utcdate = DateTime.Now.ToUniversalTime();
|
||||
var beiJingZone = TimeZoneInfo.FindSystemTimeZoneById(zoneName);
|
||||
return TimeZoneInfo.ConvertTimeFromUtc(utcdate, beiJingZone);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user