From 8602dabf305e26a4e8e7ef6ce4e2f67385dda972 Mon Sep 17 00:00:00 2001 From: dankito Date: Sun, 12 Jul 2020 18:11:32 +0200 Subject: [PATCH] Fixed initializing date with millisSinceEpoch --- .../src/iosMain/kotlin/net/dankito/utils/multiplatform/Date.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/iosMain/kotlin/net/dankito/utils/multiplatform/Date.kt b/common/src/iosMain/kotlin/net/dankito/utils/multiplatform/Date.kt index dce65c42..e1b8d20e 100644 --- a/common/src/iosMain/kotlin/net/dankito/utils/multiplatform/Date.kt +++ b/common/src/iosMain/kotlin/net/dankito/utils/multiplatform/Date.kt @@ -35,7 +35,7 @@ actual class Date(val date: NSDate) { // cannot subclass NSDate as it's a class } - actual constructor(millisSinceEpoch: Long) : this(NSDate(timeIntervalSinceReferenceDate = ((millisSinceEpoch - DiffBetweenEpochTimeAndReferenceDate) / 1000).toDouble())) + actual constructor(millisSinceEpoch: Long) : this(NSDate(timeIntervalSinceReferenceDate = ((millisSinceEpoch / 1000).toDouble() - NSTimeIntervalSince1970))) actual constructor() : this(NSDate())