diff options
author | Stefan Niedermann <info@niedermann.it> | 2020-10-29 12:34:57 +0300 |
---|---|---|
committer | Stefan Niedermann <info@niedermann.it> | 2020-10-29 12:34:57 +0300 |
commit | a0693708b224ce4fe9cf11150edbd487d4df549b (patch) | |
tree | e5920dc2e8420c857718ef99d9b5dfa28276bdba /app/src/main/java/it/niedermann/nextcloud/deck/util | |
parent | 5c858d70a08f13ae5c3dfb48d1166cf4c0ab76ce (diff) |
#715 Use java.time.*
Reset wrong last sync timestamps
Signed-off-by: Stefan Niedermann <info@niedermann.it>
Diffstat (limited to 'app/src/main/java/it/niedermann/nextcloud/deck/util')
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/util/DateUtil.java | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/util/DateUtil.java b/app/src/main/java/it/niedermann/nextcloud/deck/util/DateUtil.java index e966e922e..ac88519ff 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/util/DateUtil.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/util/DateUtil.java @@ -5,10 +5,7 @@ import android.text.format.DateUtils; import androidx.annotation.NonNull; -import java.time.Instant; import java.time.ZonedDateTime; -import java.util.Date; -import java.util.TimeZone; import it.niedermann.nextcloud.deck.R; @@ -18,27 +15,6 @@ public final class DateUtil { private DateUtil() { } - public static Instant nowInGMT() { - return convertToGMT(new Date()).toInstant(); - } - - private static Date convertToGMT(Date date) { - TimeZone tz = TimeZone.getDefault(); - Date ret = new Date(date.getTime() - tz.getRawOffset()); - - // if we are now in DST, back off by the delta. Note that we are checking the GMT date, this is the KEY. - if (tz.inDaylightTime(ret)) { - Date dstDate = new Date(ret.getTime() - tz.getDSTSavings()); - - // check to make sure we have not crossed back into standard time - // this happens when we are on the cusp of DST (7pm the day before the change for PDT) - if (tz.inDaylightTime(dstDate)) { - ret = dstDate; - } - } - return ret; - } - public static CharSequence getRelativeDateTimeString(@NonNull Context context, long time) { long now = ZonedDateTime.now().toInstant().toEpochMilli(); if ((now - time) < 60 * 1000 && now > time) { |