]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - tim/prune/config/TimezoneHelper.java
Version 19, May 2018
[GpsPrune.git] / tim / prune / config / TimezoneHelper.java
diff --git a/tim/prune/config/TimezoneHelper.java b/tim/prune/config/TimezoneHelper.java
new file mode 100644 (file)
index 0000000..f3871d4
--- /dev/null
@@ -0,0 +1,22 @@
+package tim.prune.config;
+
+import java.util.TimeZone;
+
+public abstract class TimezoneHelper
+{
+
+       /**
+        * @return the timezone selected in the Config
+        */
+       public static TimeZone getSelectedTimezone()
+       {
+               final String zoneId = Config.getConfigString(Config.KEY_TIMEZONE_ID);
+               if (zoneId == null || zoneId.equals("")) {
+                       return TimeZone.getDefault();
+               }
+               else {
+                       return TimeZone.getTimeZone(zoneId);
+               }
+       }
+
+}