TimeZone
classin packageklyn.time
public class TimeZone extends Object implements ValueType:
└ TimeZone
All Implemented Interfaces: ValueType

Represents a fixed time-zone offset, including its name and offset from UTC.

A TimeZone does not contain an IANA transition history. TimeZone.local returns the operating system offset applicable when the property is read.

import klyn.time

timeZone = TimeZone.UTC
print(timeZone.toString())  # Output: UTC (UTC+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:
Returns the operating system's current local timezone offset.
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.
public readonly property offsetMinutes
offsetMinutes as Int:
Total offset from UTC in minutes.
Inherited Properties
propertyInherited Properties from Object: type
Constructors
Modifier and Type Member Description
public TimeZone
TimeZone(name as String, offsetHours as Int, minuteOffset as Int = 0):
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.
Inherited Methods
methodInherited Methods from Object: deepCopy, fromJson, hash, toDict, toJson, toString, toXml