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 or ISO 8601 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: 0001-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.

Configuration

Input Ports

Output Ports

Note: Feature order may change in relation to other output ports. Feature order per port is maintained.

Parameters

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.

Defining Values

There are several ways to define a value for use in a Transformer. The simplest is to simply type in a value or string, which can include functions of various types such as attribute references, math and string functions, and workspace parameters. There are a number of tools and shortcuts that can assist in constructing values, generally available from the drop-down context menu adjacent to the value field.

Dialog Options - Tables

Transformers with table-style parameters have additional tools for populating and manipulating values.

FME Community

The FME Community is the place for demos, how-tos, articles, FAQs, and more. Get answers to your questions, learn from other users, and suggest, vote, and comment on new features.

Search for all results about the DateTimeCalculator on the FME Community.