Home Reference Source Repository
import {ZoneRegion} from 'js-joda/src/ZoneRegion.js'
public class | source

ZoneRegion

Extends:

ZoneId → ZoneRegion

A geographical region where the same time-zone rules apply.

Time-zone information is categorized as a set of rules defining when and how the offset from UTC/Greenwich changes. These rules are accessed using identifiers based on geographical regions, such as countries or states. The most common region classification is the Time Zone Database (TZDB), which defines regions such as 'Europe/Paris' and 'Asia/Tokyo'.

The region identifier, modeled by this class, is distinct from the underlying rules, modeled by ZoneRules. The rules are defined by governments and change frequently. By contrast, the region identifier is well-defined and long-lived. This separation also allows rules to be shared between regions if appropriate.

Specification for implementors

This class is immutable and thread-safe.

Static Method Summary

Static Public Methods
public static

ofId(zoneId: *): ZoneId

not yet implemented

Constructor Summary

Public Constructor
public

Constructor.

Method Summary

Public Methods
public

id(): string

public

Inherited Summary

From class ZoneId
public

equals(other: *): boolean

Checks if this time-zone ID is equal to another time-zone ID.

public

A hash code for this time-zone ID.

public

Normalizes the time-zone ID, returning a {@code ZoneOffset} where possible.

public

Gets the time-zone rules for this ID allowing calculations to be performed.

public

Outputs this zone as a {@code String}, using the ID.

Static Public Methods

public static ofId(zoneId: *): ZoneId source

not yet implemented

Params:

NameTypeAttributeDescription
zoneId *

Return:

ZoneId

Public Constructors

public constructor(id: string, rules: ZoneRules) source

Constructor.

Params:

NameTypeAttributeDescription
id string

the time-zone ID, not null

rules ZoneRules

the rules, null for lazy lookup

Public Methods

public id(): string source

Return:

string

public rules(): ZoneRules source

Override:

ZoneId#rules

Return:

ZoneRules