您的位置:首页 > 其它

UTC时间转换为标准时间

2011-01-14 15:46 316 查看
public DateTime UTCToDateTime(Int64 utc)
{
DateTime dtZone = new DateTime(1970, 1, 1, 0, 0, 0);
dtZone = dtZone.AddSeconds(utc);
return dtZone.ToLocalTime();
}


MessageBox.Show(UTCToDateTime
(1294675200).ToString());//得到2011-1-11 00:00:00
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: