Skip to content

Commit 7613e31

Browse files
committed
[修复]1. 修复时间计算秒数的数字溢出BUG
1 parent fb6d2d9 commit 7613e31

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

GameFrameX.Utility/TimeHelper.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@ public static long TimeToMilliseconds(DateTime time, bool utc = false)
7373
/// <param name="time">指定时间。</param>
7474
/// <param name="utc">是否使用UTC时间。</param>
7575
/// <returns>距离纪元时间的秒数。</returns>
76-
public static int TimeToSecond(DateTime time, bool utc = false)
76+
public static long TimeToSecond(DateTime time, bool utc = false)
7777
{
7878
if (utc)
7979
{
80-
return (int)(time - EpochUtc).TotalSeconds;
80+
return (long)(time - EpochUtc).TotalSeconds;
8181
}
8282

83-
return (int)(time - EpochLocal).TotalSeconds;
83+
return (long)(time - EpochLocal).TotalSeconds;
8484
}
8585

8686

0 commit comments

Comments
 (0)