Skip to content

system.timezone

Palamecia edited this page Dec 4, 2022 · 7 revisions

Module

load system.timezone

This module provides the System.TimeZone class which provides access to the time zones informations.

Packages

Classes

System.TimeZone

This class provides a stateless calculator for time zone conversions between UTC and a specific time zone.

Members

Modifiers Member Description
+ const != Returns false if the time zone described by other and this object are the...
+ const == Returns true if the time zone described by other and this object are the ...
+ @ const current Returns the current system time zone.
- @ g_lib Global library handle.
+ const getName Returns the time zone ID for the time zone.
+ const isDaylightTimeFromMilliseconds Returns true if daylight-saving was in effect at the given date and time; o...
+ const isDaylightTimeFromSeconds Returns true if daylight-saving was in effect at the given date and time; o...
+ @ const list Returns a list of all available time zone IDs on this system.
+ const millisecondsSinceEpoch Returns the amount of milliseconds since 1970-01-01T00:00:00.000Z from the gi...
- final name Internal time zone name.
+ const new Creates a new object for the time zone specified by timezone. The timezon...
+ const secondsSinceEpoch Returns the amount of seconds since 1970-01-01T00:00:00Z from the given date ...
+ @ const setCurrent Sets the system's current time zone to timezone. An instance of Exception.S...
+ const timeFromMilliseconds Returns an iterator containing the year, month, day, hours, minutes, seconds ...
+ const timeFromSeconds Returns an iterator containing the year, month, day, hours, minutes, seconds ...
+ const weekDayFromMilliseconds Returns the weekday in this timezone for the given date and time. The date an...
+ const weekDayFromSeconds Returns the weekday in this timezone for the given date and time. The date an...
+ const yearDayFromMilliseconds Returns the day in the year in this timezone for the given date and time. The...
+ const yearDayFromSeconds Returns the day in the year in this timezone for the given date and time. The...
- final zoneinfo Internal time zone informations.

Descriptions

System.TimeZone.!=

def (const self, other)

Returns false if the time zone described by other and this object are the same time zone; otherwise returns true.

System.TimeZone.==

def (const self, const other)

Returns true if the time zone described by other and this object are the same time zone; otherwise returns false.

System.TimeZone.current

def ()

Returns the current system time zone.

System.TimeZone.g_lib

lib ('libmint-system')

Global library handle.

System.TimeZone.getName

def (const self)

Returns the time zone ID for the time zone.

System.TimeZone.isDaylightTimeFromMilliseconds

def (const self, milliseconds)

Returns true if daylight-saving was in effect at the given date and time; otherwise returns false. The date and time given by milliseconds must be expressed in milliseconds elapsed since 1970-01-01T00:00:00.000Z or be an instance of System.Date.

System.TimeZone.isDaylightTimeFromSeconds

def (const self, seconds)

Returns true if daylight-saving was in effect at the given date and time; otherwise returns false. The date and time given by seconds must be expressed in seconds elapsed since 1970-01-01T00:00:00Z or be an instance of System.Date.

System.TimeZone.list

def ()

Returns a list of all available time zone IDs on this system.

System.TimeZone.millisecondsSinceEpoch

def (const self, year, month, day, h = 0, min = 0, sec = 0, ms = 0)

Returns the amount of milliseconds since 1970-01-01T00:00:00.000Z from the given date and time in this timezone.

  • year is the year of the date and must be a number.
  • month is the month of the date and must be a number between 1 and 12.
  • day is the day of the date and must be a number between 1 and 31.
  • h is the amount of hours of the time and must be a number between 0 and 23.
  • min is the amount of minutes of the time and must be a number between 0 and 59.
  • sec is the amount of seconds of the time and must be a number between 0 and 60.
  • ms is the amount of milliseconds of the time and must be a number between 0 and 999.

System.TimeZone.name

''

Internal time zone name.

System.TimeZone.new

def (self, timezone)

Creates a new object for the time zone specified by timezone. The timezone value can be any time zone identifier supported by the system, a IANA time zone ID or an offset from UTC like "-05:30". The timezone value can also be an instance of System.TimeZone.

System.TimeZone.secondsSinceEpoch

def (const self, year, month, day, h = 0, min = 0, sec = 0)

Returns the amount of seconds since 1970-01-01T00:00:00Z from the given date and time in this timezone.

  • year is the year of the date and must be a number.
  • month is the month of the date and must be a number between 1 and 12.
  • day is the day of the date and must be a number between 1 and 31.
  • h is the amount of hours of the time and must be a number between 0 and 23.
  • min is the amount of minutes of the time and must be a number between 0 and 59.
  • sec is the amount of seconds of the time and must be a number between 0 and 60.

System.TimeZone.setCurrent

def (timezone)

Sets the system's current time zone to timezone.

An instance of Exception.SystemError is raised on error.

System.TimeZone.timeFromMilliseconds

def (const self, milliseconds)

Returns an iterator containing the year, month, day, hours, minutes, seconds and milliseconds in this timezone for the given date and time. The date and time given by milliseconds must be expressed in milliseconds elapsed since 1970-01-01T00:00:00.000Z or be an instance of System.Date.

System.TimeZone.timeFromSeconds

def (const self, seconds)

Returns an iterator containing the year, month, day, hours, minutes, seconds and milliseconds in this timezone for the given date and time. The date and time given by seconds must be expressed in seconds elapsed since 1970-01-01T00:00:00Z or be an instance of System.Date.

System.TimeZone.weekDayFromMilliseconds

def (const self, milliseconds)

Returns the weekday in this timezone for the given date and time. The date and time given by milliseconds must be expressed in milliseconds elapsed since 1970-01-01T00:00:00.000Z or be an instance of System.Date.

The System.WeekDay enum can be used to check returned values.

System.TimeZone.weekDayFromSeconds

def (const self, seconds)

Returns the weekday in this timezone for the given date and time. The date and time given by seconds must be expressed in seconds elapsed since 1970-01-01T00:00:00Z or be an instance of System.Date.

The System.WeekDay enum can be used to check returned values.

System.TimeZone.yearDayFromMilliseconds

def (const self, milliseconds)

Returns the day in the year in this timezone for the given date and time. The date and time given by milliseconds must be expressed in milliseconds elapsed since 1970-01-01T00:00:00.000Z or be an instance of System.Date.

System.TimeZone.yearDayFromSeconds

def (const self, seconds)

Returns the day in the year in this timezone for the given date and time. The date and time given by seconds must be expressed in seconds elapsed since 1970-01-01T00:00:00Z or be an instance of System.Date.

System.TimeZone.zoneinfo

null

Internal time zone informations.

Clone this wiki locally