FME Transformers: 2024.1

Categories
Calculated Values
Database
Related Transformers
DateTimeConverter
DateTimeRounder
DateTimeStamper
FME Date/Time Format
FME Date/Time Functions

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

Transformer parameters can be set by directly entering values, using expressions, or referencing other elements in the workspace such as attribute values or user parameters. Various editors and context menus are available to assist. To see what is available, click beside the applicable parameter.

For more information, see Transformer Parameter Menu Options.

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.