TimeZone
classin packageklyn.time
public class TimeZone extends Object implements ValueType:
Represents a time zone, including its name and offset from UTC.
This class provides predefined time zones and methods to create and manipulate time zone objects.
It includes static properties for common time zones and methods to convert between time zone names and objects.
import klyn.time
timeZone = TimeZone.GMT
print(timeZone.toString()) # Output: GMT (UTC+0)
@since 1.0
Properties
| Modifier and Type |
Member |
Description |
| public static readonly property |
UTC |
UTC timezone. |
| public static readonly property |
local |
Local timezone (best-effort, currently UTC by default). |
| public readonly property |
name |
IANA-like short identifier (examples: UTC, CET). |
| public readonly property |
offsetHours |
Offset from UTC in hours. |
Constructors
| Modifier and Type |
Member |
Description |
| public |
TimeZone |
Constructs a TimeZone object with a given name and offset. |
Methods
| Modifier and Type |
Member |
Description |
| public override |
toString |
Returns a string representation of this TimeZone object. |