You are here: Calculated Values > DateTimeCalculator

DateTimeCalculator

Performs arithmetic on date, time, datetime, and interval values. In Advanced Expression mode, composite expressions involving datetimes and intervals may be constructed.

See also: Date/Time Terminology, Date/Time Format, Date/Time Functions

The DateTimeCalculator performs arithmetic on five temporal types:

  1. Date
  2. Time
  3. Time with UTC offset
  4. Datetime
  5. Datetime with UTC offset

The input temporal strings must be in FME format.

DateTimeCalculator also supports interval arithmetic, where the interval can be specified in one of two ways:

  • Specified by part. For example, the user can specify 5 for the value of “Years”.
  • Specified by an interval string in ISO 8601 duration format.

Invalid temporal and interval input will cause date time functions that consume them to return null, and cause the feature to be rejected.

Limitations:

  • Supported temporal range: 1000-01-01 00:00:00.000000000 to 9999-12-31 23:59:59.999999999.
  • If the input temporal value contains fractional seconds, only the decimal separator “.” is supported.
  • When subtracting a temporal value from another, the two temporal values must have compatible temporal types, or the feature will be rejected. Please see the type compatibility matrix.
  • If an interval is specified by parts, then the part values must be either all non-negative, or all non-positive, or the feature will be rejected.

Input Ports

Output Ports

Parameters

Reference

See also:

Editing Transformer Parameters

Using a set of menu options, transformer parameters can be assigned by referencing other elements in the workspace. More advanced functions, such as an advanced editor and an arithmetic editor, are also available in some transformers. To access a menu of these options, click beside the applicable parameter. For more information, see Transformer Parameter Menu Options.

Transformer Categories

Calculated Values

Search FME Knowledge Center

Search for samples and information about this transformer on the FME Knowledge Center.