Geneos ["Geneos"]
You are currently viewing an older version of the documentation. End of life for version 5.x.x is scheduled for 30 September 2025.
If you are currently using version 5.x.x, we advise you to upgrade to the latest version before the EOL date. You can find the latest documentation here.
["Geneos > Gateway"]["Technical Reference"]

Time Zones and Time Formats

Time Zone Data

Geneos uses the operating system's time zone files, typically located at /usr/share/zoneinfo/, to convert between time zones and to parse or format dates. These files determine the time zone names and time zone abbreviations that Geneos uses.

Time zone names can be used when configuring ActiveTime periods, scheduled events, and in Time arguments in internal commands. See Appendix: Internal Commands in Gateway Commands for more information. Time zone abbreviations can be used when defining rules to parse and format strings containing timestamps.

The Gateway binary is also accompanied by a time zone resources file that is used exclusively when parsing dates that include time zone abbreviations. This occurs when parsing dates in rules and when parsing information from dataviews for standard formatting. See Standardised formatting in Publish to Kafka.

The Gateway time zone resources file is also available separately as a package from ITRS Resources. The package contains the time zone file and a README file with installation instructions.

Be aware of the following:

  • Mappings between abbreviations and time zones specified in the time zone resource file and in the Operating Environment setup are only used for parsing input timestamps and never for formatting output.
  • The time zone resource file also contains information about the UTC offsets and daylight savings time of different time zones. This information is not used by Gateway.

Parsing time zone abbreviations

Time zone abbreviations, such as "EST" are inherently ambiguous. In order to deal with ambiguities Geneos prioritises possible mappings.

The time zone resources file, which is sorted by the ID field in alphabetical order, is used when parsing time zone abbreviations. When the Gateway has to map an abbreviation to a time zone, it takes the ID for the first matching abbreviation in the STD ABBR field of the time zone resources file. If an entry is found where the STD ABBR field matches the abbreviation and the STD NAME field is set, this will take priority over any earlier entry in the time zone resources file that only matches the STD ABBR field. The settings made in operatingEnvironment > timezoneabbreviation in Operating Environment take priority over any matches found in the time zone resources file.

Time formatting parsing codes

The following formatting codes can be used in rule functions and with certain plug-ins.

Specifier Replaced by
%a, %A Day of the week; either abbreviated or full name. (e.g. Thu or Thursday)
%b, %B Month Name; either abbreviated or full name (eg Aug or August)
%c Date and time representation (local dependant)
%d Day of the month [01,31]; leading zeros are permitted but not required.
%D The date as %m/%d/%y
%e Day of the month [01,31]; leading zeros are permitted but not required.
%f1 Milliseconds. (Reads between 0 and 3 digits). The period is part of this code, to read seconds and milliseconds use %S%f. If you do not want the period included in the code please use %Of which reads just the digits.
%F The date as %Y-%m-%d
%g1 Microseconds. (Reads between 0 and 6 digits). The period is part of this code, to read seconds and microseconds use %S%g. If you do not want the period included in the code please use %Og which reads just the digits.
%H Hour in 24h format [00,23]; leading zeros are permitted but not required.
%I Hour in 12h format [01,12]; leading zeros are permitted but not required.
%m Month as a decimal number [01,12]; leading zeros are permitted but not required.
%M Minute [00,59]; leading zeros are permitted but not required.
%p AM or PM designation
%r The time as %I:%M:%S %p
%R The time as %H:%M
%s The number of seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC)
%S Second [00,60]; leading zeros are permitted but not required.
%T The time as %H:%M:%S
%x The date as %m/%d/%y
%X The time as %H:%M:%S
%y Year, last two digits [00,99]
%Y Year, last all digits (e.g. 2008)
%z Timezone offset from GMT [+|-]:hh:mm
%Z Timezone standard/day light saving abbreviation (ie EET or EEST)
%+ The date and time as "%a %b %e %H:%M:%S %Z %Y"
%% A % sign

Note: The formats specified above with super-script 1 are useful only for messageTracker timestamp format.

On UNIX systems some conversion specifications can be modified by preceding the conversion specifier character by the E or O modifier to indicate that an alternative format should be used. If the alternative format or specification does not exist for the current locale, the behaviour will be as if the unmodified conversion specification were used. (SU) The Single Unix Specification mentions %Ec, %EC, %Ex, %EX, %Ey, %EY, %Od, %Oe, %OH, %OI, %Om, %OM, %OS, %Ou, %OU, %OV, %Ow, %OW, %Oy, where the effect of the O modifier is to use alternative numeric symbols (say, roman numerals), and that of the E modifier is to use a locale-dependent alternative representation.

See also: Time Zone Data.

Time Formatting Printing Codes

The following formatting codes can be used in rule functions, with certain plug-ins and for gateway log file rotation.

Specifier Replaced by
%a Abbreviated weekday name (ie Thu)
%A Full weekday name (ie Thursday)
%b Abbreviated month name (ie Aug)
%B Full month name (ie August)
%c Date and time representation (local dependant)
%C The century number (year/100) as a 2-digit integer [00,99]
%d Day of the month [01,31]; leading zeros are permitted but not required.
%D The date as %m/%d/%y
%e Day of the month [01,31]; leading zeros are permitted but not required.
%F1 The date as %Y-%m-%d
%g1 Week-based year within century [00,99]
%G1 Week-based year, including the century [0000,9999]
%h Equivalent to %b
%H Hour in 24h format [00,23]; leading zeros are permitted but not required
%I Hour in 12h format [01,12]; leading zeros are permitted but not required
%j Day of the year [001,366]; leading zeros are permitted but not required
%k Hour in 24h format (0-23); single digits are preceded by a blank
%l1 Hour in 12h format (1-12); single digits are preceded by a blank
%m Month as a decimal number [01,12]; leading zeros are permitted but not required
%M Minute [00,59] ; leading zeros are permitted but not required
%n Insert a NEWLINE
%p AM or PM designation; Noon is treated as 'pm' and midnight as 'am'
%P1 Like %p but in lowercase: 'am' or 'pm'
%r The time as %I:%M:%S %p
%R The time as %H:%M
%s The number of seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC)
%S Second [00,60]; leading zeros are permitted but not required. The range is up to 60 to allow for occasional leap seconds.
%t Insert a TAB
%T The time as %H:%M:%S
%u The day of the week as a decimal, range 1 to 7, Monday being 1
%U Week number with the first Sunday as the first day of week one [00,53]
%V Week number of the current year as a decimal number, range 01 to 53, where week 1 is the first week that has at least 4 days in the current year, and with Monday as the first day of the week.
%w Weekday as a decimal number with Sunday as 0 [0,6]
%W Week number with the first Monday as the first day of week one [00,53]
%x Date representation (local dependant)
%X Time representation (local dependant)
%y Year, last two digits [00,99]
%Y Year, last all digits (e.g. 2008)
%z1 The time-zone as hour offset from GMT
%Z Timezone name or abbreviation (ie CDT)
%+1 The date and time as "%a %b %e %H:%M:%S %Z %Y"
%% A % sign

Points of Note:

  • The formats above with super-script 1 are not supported on AIX.
  • To omit padding of numeric results, use the hyphen after %. E.g. "%-d".
  • On UNIX systems some conversion specifications can be modified by preceding the conversion specifier character by the E or O modifier to indicate that an alternative format should be used. If the alternative format or specification does not exist for the current locale, the behaviour will be as if the unmodified conversion specification were used. (SU) The Single Unix Specification mentions %Ec, %EC, %Ex, %EX, %Ey, %EY, %Od, %Oe, %OH, %OI, %Om, %OM, %OS, %Ou, %OU, %OV, %Ow, %OW, %Oy, where the effect of the O modifier is to use alternative numeric symbols (say, roman numerals), and that of the E modifier is to use a locale-dependent alternative representation.

Regular Expression Types Used In Plugins

The following table provides a summary of the types of regular expression used in the various plugins.

Plugin Types of regular expression supported
FKM By default uses POSIX extended regular expression syntax. If the configuration setting isPCREMode is set to true, it will use PCRE (Perl Compatible Regular Expressions) instead.
Message Tracker Perl Regular Expressions (perlre)
State Tracker Perl Compatible Regular Expressions (PCRE)
FIX-analyzer PCRE
IMXA POSIX extended
Webmon Perl Compatible Regular Expression
Processes

By using the configuration setting regexMode, the user can choose between the following regular expression types:

  • Berkeley - Berkeley library interface. On some platforms this may make a difference to the pattern matching algorithm. It is highly recommend that you use one of the other modes unless you have a specific reason for choosing this one.
  • Normal - POSIX regular expression syntax.
  • Extended - POSIX extended regular expression syntax.
  • PCRE - Perl compatible regular expression syntax.
  • None - text is searched for in string as is (case insensitive by default).

If regexMode is not set, the default is that POSIX extended regular expression syntax is used.