首页 > 代码库 > C#.net时间戳转换

C#.net时间戳转换

//long ticks = (DateTime.Parse(DateTime.Now.ToString(CultureInfo.InvariantCulture)).ToUniversalTime().Ticks - 621355968000000000) / 10000000;

//long timeticks = long.Parse("621355968000000000") + ticks * 10000000;
//DateTime time = new DateTime(timeticks).AddHours(8);//相差8小时

 

参考:

http://tool.chinaz.com/Tools/unixtime.aspx

 

C#.net时间戳转换