Skip to content

Commit 60e8175

Browse files
Fix UTC DateTime conversion (#3333)
SKTimeDateTimeInternal assumes the DateTime is local, but it might be UTC.
1 parent 7c23ad6 commit 60e8175

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

binding/SkiaSharp/Definitions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ internal partial struct SKTimeDateTimeInternal
360360
{
361361
public static SKTimeDateTimeInternal Create (DateTime datetime)
362362
{
363-
var zone = datetime.Hour - datetime.ToUniversalTime ().Hour;
363+
var zone = datetime.ToLocalTime ().Hour - datetime.ToUniversalTime ().Hour;
364364
return new SKTimeDateTimeInternal {
365365
fTimeZoneMinutes = (Int16)(zone * 60),
366366
fYear = (UInt16)datetime.Year,

0 commit comments

Comments
 (0)