Live File Processor Agent File – Date Time

<< Click to Display Table of Contents >>

Navigation:  Live > Agents > File Agents > File Processor > Settings > File >

Live File Processor Agent File – Date Time

The date and time settings are used to set DT_LOGGER_DATUM.DATUM_UTC_DT.

 

Setting

Type

Description

dateTimeColumnHeaderRegex

Regex

Date and time (or date only) column header text pattern.

e.g., Date.*Time (see Geokon example) or Date|Date Time (see YSI-6 example).

 

A date and time column must be present in all files that the agent processes.

dateTimeFormats

String

One or more of the following:

'local' uses the date and time format in the user's local settings: Control Panel > Clock and Region > Change date, time, or numbers formats > Formats tab > Format, e.g., English (Australia). However, if this agent is running as a service, it is the service's Log On As account date and time format that is used, not the date and time format of the user that is currently logged in. If the service's Log On As account date and time format is not known, a safer alternative is to use a culture info name, as described in the next bullet.

Culture info name, e.g., 'en-AU' for English (Australia). (See http://www.csharp-examples.net/culture-names/ for a list of culture names, but note that this list may vary from one computer to another. Also, see HOBO example).

Custom date and time format string, e.g., 'dd-MM-yyyy HH:mm' (see YSI-6 example).

Additional custom format strings:

Format String

Description

OA

OLE Automation date (see Geokon example).

UNIX-MS

Unix time; the number of milliseconds that have elapsed since 1970-01-01T00:00:00Z.

UNIX-S

Unix time; the number of seconds that have elapsed since 1970-01-01T00:00:00Z.

Empty lets the DateTime.TryParse method figure out the date and time format automatically, using an invariant culture info that is independent of the user's local settings.

e.g., dateTimeFormats = 'dd-MM-yyyy HH:mm|d/M/y H:m:s|'

 

Split using '|' = { 'dd-MM-yyyy HH:mm', 'd/M/y H:m:s', '' }

 

1.Try to parse date time using dd-MM-yyyy HH:mm (day-month-year hour:minute).

Else

2.Try to parse date time using d/M/y H:m:s (day/month/year hour:minute:second).

Else

3.Try to parse date time automatically.

 

If all three fail, log an error message, and continue with the next line of data.

 

Note: The order in which these formats are tried is guaranteed—the first format in the list, dd-MM-yyyy HH:mm, is always tried first.

 

Warning: Do not include both day first (e.g., dd-MM-yyyy) and month first (e.g., MM-dd-yyyy) date and time formats in dateTimeFormats, as this can run into problems if the date and time can be interpreted as both.

 

Also, see note about dates and times in Excel files.

 

Default Value: en-US

dateTimeHeaderLinesRegexGroups


Gets the date-time from the file's header.

dateTimeIntervalDefaultValue


Used if (there's no date-time-column and) a date-time is defined in the file's header (i.e., if using dateTimeHeaderLinesRegexGroups).

 

The value can be positive or negative, e.g., 00:00:30 (30 seconds) or -00:00:30 (negative 30 seconds).

 

The first data line's date-time is the date-time in the file's header, and then this value is added to (or subtracted from) each subsequent data line that is processed.

timeColumnHeaderRegex

Regex

Time (only) column header text pattern.

 

e.g., Time (see YSI-6 example).

 

Added to dateTimeColumnHeaderRegex column value.

timeFormats

String

Same as dateTimeFormats, except this setting is used to parse timeColumnHeaderRegex, instead of dateTimeColumnHeaderRegex.

 

e.g., HHmmss|

 

Split format strings using pipes; = { 'HHmmss', '' }

 

1.Try to parse time using HHmmss (hour minute second, without spaces or colons, e.g., 082613 => hour = 08, minute = 26, second = 13).

Else

2.Try to parse time automatically.

 

If both fail, log an error message, and continue with the next line of data.

utcOffsetColumnHeaderRegex

Regex

DT_LOGGER_DATUM.DATUM_UTC_DT = file dates and times minus:

1.utcOffsetColumnHeaderRegex – The value in this column, if this setting is not empty and a column exists in the file whose header text matches this pattern, and the value is not whitespace.

Else

2.utcOffsetHeaderLinesRegexGroups – This named group's value, if this setting is not empty and this pattern exists in the file's header (see HOBO example, and YSI-EXO example).

Else

3.utcOffsetDefaultValue (see Solinst example), or 0 if utcOffsetDefaultValue is not defined or empty (see LoggerDatum example).

 

Note: If using a time zone name (utcOffsetFormats = 'TZ'), e.g., 'Eastern Standard Time', the UTC offset hours will be adjusted for DST (if the time zone observes daylight saving time). For example, UTC – 5 hours during standard time, and UTC – 4 hours during daylight time.

utcOffsetHeaderLines
RegexGroups

Regex Named Groups

utcOffsetDefaultValue

String

utcOffsetFormats

String

One or more of the following:

'local' uses the time span format in the user's local settings (also see dateTimeFormats).

Culture info name (also see dateTimeFormats).

Standard or custom time span format string.

Additional custom format strings:

Format String

Description

HH

The number of hours (e.g., -5 for Eastern Time, or -3.5 for Newfoundland).

MM

The number of minutes (e.g., -300 for Eastern Time, or -210 for Newfoundland).

TZ

The time zone identifier (e.g., 'Eastern Standard Time', or 'Newfoundland Standard Time').

Note: The time zone identifiers are the standard names; the daylight names (e.g., 'Eastern Daylight Time') and abbreviations (e.g., 'EST' and 'EDT') cannot currently be used to find the time zone.

Empty lets the TimeSpan.TryParse method figure out the time span format automatically, using an invariant culture info that is independent of the user's local settings (see HOBO example).

 

Default Value: HH|TZ|