Skip to main content

HS.Timezone.SYS.SetupUtility

class HS.Timezone.SYS.SetupUtility

This class provides methods to convert from database files provided by IANA timezone database to JSON format.

Method Inventory

Parameters

parameter TABCHAR;

Methods

classmethod ConvertDate(dateString As %String) as %String
Helper method for indexing months into integers within date strings. Inputs: dateString - the date string as YYYY (month) DD, where (month) is written out in English; others are written numerically
classmethod TableToJSON(pathName As %String)
Method for converting a table-only text file to JSON format. Creates two files, one for rules and another for timezones. Inputs: pathName - the path of the table text file(s) to convert
classmethod TimezoneListFromLine(line As %String, zoneName As %String = "") as %List
Helper method for converting lines in the TZ specification into workable lists Each line is generally tab-delimited, though exceptions occur due to human input error (spaces used instead of tabs). Extra processing on our end resolves these discrepancies. Rules are generally of the form "Rule[Region][FromYear][ToYear][Type][Month][Day][Time][Offset][AbbreviationLetter]" Zones are generally of the form "[Zone/blank][Name/blank][StdOffset][Rule to reference][Format, ending in T][UntilDate]" Output varies depending on Rule/Zone, but: Lists for rules are of form ("Rule", "[Region]", "[FromYear]", "[ToYear/"only"]", "-", "[Month]", "[Day]", "[Time]", "[Offset]", "[AbbreviationLetter]") Lists for zones are of form ("Zone", "[Name]", "[StdOffset]", "[Rule/"-"]", "[Abbreviation]", "[UntilDate]") Note that the field for Type in Rule is a hyphen and does not provide any substantive information, but was kept as a placeholder to preserve indexing. Inputs: line - the line to be parsed and converted into a list of substrings representing fields for preordained columns zoneName - an optional argument that helps for zone lines only, used as a reference for the zone for the case when it is a continuation of previous line(s)
FeedbackOpens in a new tab