diff options
Diffstat (limited to 'format-common/src/main/kotlin/dev/msfjarvis/aps/util/time')
| -rw-r--r-- | format-common/src/main/kotlin/dev/msfjarvis/aps/util/time/Clocks.kt | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/format-common/src/main/kotlin/dev/msfjarvis/aps/util/time/Clocks.kt b/format-common/src/main/kotlin/dev/msfjarvis/aps/util/time/Clocks.kt deleted file mode 100644 index 087a5028..00000000 --- a/format-common/src/main/kotlin/dev/msfjarvis/aps/util/time/Clocks.kt +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved. - * SPDX-License-Identifier: GPL-3.0-only - */ - -package dev.msfjarvis.aps.util.time - -import java.time.Clock -import java.time.Instant -import java.time.ZoneId -import javax.inject.Inject - -/** - * A subclass of [Clock] that uses [Clock.systemDefaultZone] to get a clock that works for the - * user's current time zone. - */ -public open class UserClock @Inject constructor() : Clock() { - - private val clock = systemDefaultZone() - - override fun withZone(zone: ZoneId): Clock = clock.withZone(zone) - - override fun getZone(): ZoneId = clock.zone - - override fun instant(): Instant = clock.instant() -} |
