IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
IKVM.Java.Externs.java.util.TimeZone Class Reference

Implements the native methods for 'java.util.TimeZone'. More...

Static Public Member Functions

static string getSystemTimeZoneID (string javaHome)
 Implements the native method 'getSystemTimeZoneID'.
 
static string getSystemGMTOffsetID ()
 Implements the native method 'getSystemGMTOffsetID'.
 

Detailed Description

Implements the native methods for 'java.util.TimeZone'.

Definition at line 12 of file TimeZone.cs.

Member Function Documentation

◆ getSystemGMTOffsetID()

static string IKVM.Java.Externs.java.util.TimeZone.getSystemGMTOffsetID ( )
static

Implements the native method 'getSystemGMTOffsetID'.

Returns

Definition at line 81 of file TimeZone.cs.

82 {
83 var sp = TimeZoneInfo.Local.GetUtcOffset(DateTime.Now);
84 var h = sp.Hours;
85 var m = sp.Minutes;
86 if (h == 0 && m == 0)
87 return "GMT";
88 else if (h >= 0 && m >= 0)
89 return $"GMT+{h:D2}:{m:D2}";
90 else
91 return $"GMT-{-h:D2}:{-m:D2}";
92 }

◆ getSystemTimeZoneID()

static string IKVM.Java.Externs.java.util.TimeZone.getSystemTimeZoneID ( string javaHome)
static

Implements the native method 'getSystemTimeZoneID'.

Parameters
javaHome
Returns

Definition at line 69 of file TimeZone.cs.

70 {
72 return MatchJavaTZ(javaHome, GetCurrentTimeZoneID()) ?? getSystemGMTOffsetID();
73 else
74 return GetCurrentTimeZoneID() ?? getSystemGMTOffsetID();
75 }
static string getSystemGMTOffsetID()
Implements the native method 'getSystemGMTOffsetID'.
Definition TimeZone.cs:81
Maintains various information about the current runtime environment.
static bool IsWindows
Returns true if the current platform is Windows.

The documentation for this class was generated from the following file: