Skip to main content

HS.Timezone.API.Service

abstract class HS.Timezone.API.Service extends %ZHSLIB.Context.ServiceBase

Method Inventory

Parameters

parameter ServiceKey = HS.Timezone.API.Service;
Inherited description: The unique key for the service (e.g. classname).
@API.Overrideable
parameter ServiceVersion = 1.0.0;
Inherited description: Semantic version of the Service. Must be a version string with the following format: .. @API.Overrideable

Methods

abstract method ConvertToLocalTime(timezone As %String, timestamp As %TimeStamp) as %TimeStamp
Returns the local time in a given time zone at the same instant as the provided timestamp. If the provided timestamp doesn't have an offset, it is assumed to already be in local time for that time zone.
@API.Method @Argument timezone The name of a time zone supported by the service @Argument timestamp Date and time to be converted to the local time of the time zone. May include a UTC offset
abstract method GetAbbreviation(timezone As %String, timestamp As %TimeStamp) as %String
Returns the time zone abbreviation in a given time zone, at the given time. That means it will take into account daylight savings time and any historical rule changes for the time zone.
@API.Method @Argument timezone The name of a time zone supported by the service @Argument timestamp Date and time the requested abbreviation is applicable for
abstract method GetFormattedName(timezone As %String) as %String
Returns the formatted (display) name for a time zone. A formatted name will replace underscores with spaces, list time zone format(s), and list UTC offset(s). Eg. "America/New_York" will return "America/New York (EST/EDT) -05:00/-04:00".
@API.Method @Argument timezone The name of a time zone supported by the service
abstract method GetOffset(timezone As %String, timestamp As %TimeStamp) as %String
Returns the UTC offset in a given time zone, at the given time. That means it will take into account daylight savings time and any historical rule changes for the time zone.
@API.Method @Argument timezone The name of a time zone supported by the service @Argument timestamp Date and time the requested offset is applicable for
abstract method IsDST(timezone As %String, timestamp As %TimeStamp) as %Boolean
Returns whether daylight savlings time is in effect in a given time zone, at the given time. That means it will take into account daylight savings time and any historical rule changes for the time zone.
@API.Method @Argument timezone The name of a time zone supported by the service @Argument timestamp Date and time the requested offset is applicable for
abstract method IsValid(timezone As %String) as %Boolean
Returns true if a timezone is valid @Argument timezone The name of a time zone supported by the service @API.Method
abstract method ListRegions() as %DynamicArray
Lists the names of all regions containing time zones supported by the service.
@API.Method
abstract method ListTimezonesByRegion(region As %String) as %DynamicArray
Lists the names of all time zones in a region supported by the service.
@API.Method @Argument region Region to request time zones for

Inherited Members

Inherited Methods

Subclasses

FeedbackOpens in a new tab