Commit 927dbc4e authored by 黄奎's avatar 黄奎

页面修改

parent ae14a38d
......@@ -653,8 +653,8 @@ namespace Edu.Common
/// <returns>Unix时间戳格式</returns>
public static long ConvertDateTimeInt(DateTime dateTime)
{
DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
return (int)(dateTime - startTime).TotalSeconds;
DateTime dd = TimeZoneInfo.ConvertTime(new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), TimeZoneInfo.Local);
return (int)(dateTime - dd).TotalSeconds;
}
/// <summary>
......@@ -664,7 +664,7 @@ namespace Edu.Common
/// <returns>C#格式时间</returns>
public static DateTime GetTime(string timeStamp)
{
DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
DateTime dtStart = TimeZoneInfo.ConvertTime(new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc), TimeZoneInfo.Local);
long lTime = long.Parse(timeStamp + "0000000");
TimeSpan toNow = new TimeSpan(lTime);
return dtStart.Add(toNow);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment