Fixed initializing date with millisSinceEpoch

This commit is contained in:
dankito 2020-07-12 18:11:32 +02:00
parent 2027092ff9
commit 8602dabf30
1 changed files with 1 additions and 1 deletions

View File

@ -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())