summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2023-06-22 00:00:04 +0200
committerMikael Magnusson <mikma@users.sourceforge.net>2023-10-24 22:00:28 +0200
commita76aba6cfbc31774a67d28bca1aa0cd1c5c52e9d (patch)
treeedd4151c879e4d532eeb372f718933f7e75bfe75
parente05e0dffe1b313998c0d491be13b5b63a405f836 (diff)
WIP: localtime dhcp
-rw-r--r--tunnel/src/main/java/com/wireguard/android/backend/Dhcp.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/tunnel/src/main/java/com/wireguard/android/backend/Dhcp.java b/tunnel/src/main/java/com/wireguard/android/backend/Dhcp.java
index c4043625..41060ddf 100644
--- a/tunnel/src/main/java/com/wireguard/android/backend/Dhcp.java
+++ b/tunnel/src/main/java/com/wireguard/android/backend/Dhcp.java
@@ -10,6 +10,8 @@ import com.wireguard.util.NonNullForAll;
import java.time.Duration;
import java.time.Instant;
+import java.time.LocalTime;
+import java.time.ZoneId;
import java.util.LinkedHashSet;
import java.util.Set;
@@ -42,7 +44,11 @@ public class Dhcp {
}
public String toString() {
- return address.toString() + " (valid " + this.validTs + "s, preferred " + this.preferredTs + "s)";
+ ZoneId zone = ZoneId.systemDefault();
+ LocalTime validLocal = validTs.atZone(zone).toLocalTime().withNano(0);
+ LocalTime preferredLocal = preferredTs.atZone(zone).toLocalTime().withNano(0);
+ // TODO add date when needed
+ return address.toString() + " (valid " + validLocal + ", preferred " + preferredLocal + ")";
}
}