Skip to main content

HS.Timezone.Server.Service

class HS.Timezone.Server.Service extends HS.Timezone.API.Service

Method Inventory

Methods

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.
@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
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.
@Argument timezone The name of a time zone supported by the service @Argument timestamp Date and time the requested abbreviation is applicable for
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".
@Argument timezone The name of a time zone supported by the service
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.
@Argument timezone The name of a time zone supported by the service @Argument timestamp Date and time the requested offset is applicable for
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.
@Argument timezone The name of a time zone supported by the service @Argument timestamp Date and time the requested offset is applicable for
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
method ListRegions() as %DynamicArray
Lists the names of all regions containing time zones supported by the service.
method ListTimezonesByRegion(region As %String) as %DynamicArray
Lists the names of all time zones in a region supported by the service.
@Argument region Region to request time zones for

Inherited Members

Inherited Methods

FeedbackOpens in a new tab