In each distribution of LogicBlox, there are two CSV files pertaining to supported time zones:
logicblox-4.x.x
|
└─share
|
└─logicblox
|
└─BlockResources
|
└─timezone
| date_time_zonespec_one_reg_per_tz_code.csv
| date_time_zonespec.csv
Which is the correct one to use when building applications which use time zones? Are valid time zones held in an internal predicate which we can print?
The main timezone specification file is date_time_zonespec.csv. This data is used with datetime-related built-ins, such as datetime:format, parse, create etc. There is currently no way in logic to obtain the list of valid regions or timezone codes.
The file one_reg_per_tz_code is only used to map a timezone code (for example EST) to a default region (for example America/New_York). The reason this file exists is that the lower-level datetime library that we use (boost) supports most timezone notations only as output, not input. The reason for this is that some common timezone notations are surprisingly not a unique indication of a set of timezone rules (e.g. AST/ADT does not have the same rules, and EST is used by Australia as well as the US). Unfortunately, in practice we do have to work with data that uses such timezone notations, so we use this csv file to map the timezone codes to one specific region that does indicate a unique set of timezone rules. This default mapping we picked might not be the desired one for your application though.
It is best to always work with region codes (like America/New_York) to avoid any confusion.
I expect that in the medium-term we will change our datetime and timezone handling to a different library. One reason is the poor parsing support in boost, but another reason is that we really want to use a timezone database with all historical timezone rules, not just the current ones (as specified by this spec file).