瀏覽代碼

[cs] Fix Date.fromTime (see #4584)

This fixes failing test added in eca09499dc7b101eaacd2d1ad61f60ddde506e43 on my machine.
I expected it to fail on Travis as well, but it didn't for some reason. Probably it has something to do
with sytem clock set to UTC on *nixes, let's see if that commit will fail on AppVeyor (and fixed by this commit).
Dan Korostelev 9 年之前
父節點
當前提交
3d08598711
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      std/cs/_std/Date.hx

+ 1 - 1
std/cs/_std/Date.hx

@@ -106,7 +106,7 @@ import haxe.Int64;
 
 	static public inline function fromTime( t : Float ) : Date
 	{
-		return new Date(new DateTime(cast(t * cast(TimeSpan.TicksPerMillisecond, Float), Int64) + epochTicks));
+		return new Date(cs.system.TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(cast(t * cast(TimeSpan.TicksPerMillisecond, Float), Int64) + epochTicks)));
 	}
 
 	static public function fromString( s : String ) : Date