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 73a332c6..3ca108c2 100644 --- a/common/src/iosMain/kotlin/net/dankito/utils/multiplatform/Date.kt +++ b/common/src/iosMain/kotlin/net/dankito/utils/multiplatform/Date.kt @@ -29,7 +29,10 @@ actual class Date(val date: NSDate) { // cannot subclass NSDate as it's a class dateComponents.month = month.toLong() dateComponents.day = day.toLong() - return NSCalendar.currentCalendar.dateFromComponents(dateComponents) !! + val calendar = NSCalendar.currentCalendar + val todayInUtc = calendar.dateFromComponents(dateComponents) !! + + return calendar.dateByAddingUnit(NSCalendarUnitSecond, NSTimeZone.defaultTimeZone.secondsFromGMT, todayInUtc, 0)!! }