/// <summary>
/// get utc+8 当时时间
/// </summary>
/// <returns></returns>
public static DateTime GUTCA8()
{
string id = "China Standard Time";
DateTime rst = TryZoneTime(DateTime.Now,id);
return rst;
} public static DateTime TryZoneTime( DateTime time, string timeZoneId)
{
try
{
var timeZone = TimeZoneInfo.FindSystemTimeZoneById (timeZoneId);
return TimeZoneInfo.ConvertTime(time, timeZone);
}
catch { }
return time;
}
相关文章
- 如何在PHP中设置get_file_contents的时间限制?
- wordpress中文章发布时间不显示?用get_the_date代替the_date
- file_get_contents微信头像等待时间过长的原因
- selenium学习笔记——driver.get(url) 页面加载时间太长
- 【spring mvc】后台API查询接口,get请求,后台Date字段接收前台String类型的时间,报错default message [Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'createDate';
- 利用碎片化时间Get Linux系统
- 如何通过sql函数now()获取php函数'get_date()'和表中存储时间之间的不同时间?
- PowerShell中使用Get-Date获取日期时间并格式化输出的例子
- 90后毕业后的伤感签名 当时间和耐心都已变成奢侈品
- 详解PHP内置访问资源的超时时间 time_out file_get_contents read_file