TimeZone
class in package klyn.time

    public class TimeZone extends Object implements ValueType:

Object
└ TimeZone
All Implemented Interfaces: 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 as TimeZone:` | UTC timezone.
public static readonly property | local `local as TimeZone:` | Local timezone (best-effort, currently UTC by default).
public readonly property | name `name as String:` | IANA-like short identifier (examples: UTC, CET).
public readonly property | offsetHours `offsetHours as Int:` | Offset from UTC in hours.

Properties inherited from Object: type
Constructors

Modifier and Type | Member | Description
--- | --- | ---
public | TimeZone `TimeZone(name as String, offsetHours as Int):` | Constructs a TimeZone object with a given name and offset.

Methods

Modifier and Type | Member | Description
--- | --- | ---
public override | toString `toString() as String:` | Returns a string representation of this TimeZone object.

Methods inherited from Object: fromJson, toDict, toJson, toString, toXml