Tutorial: Working with Date and Time Attributes

Liz Sanderson
Liz Sanderson
  • Updated

FME Version

Introduction

Dates and times are transformed in FME using a trio of powerful transformers. These transformers are:

These transformers can carry out a multitude of operations on dates and times. They are backed up by a variety of FME Date/Time functions that can be used in text editor dialogs and the like.

 

Some examples of these functions are:

  • DateTimeAdd(): Add a specific date/time interval to a datetime; one aspect of datetime arithmetic.
  • DateTimeFormat(): Convert a date/time attribute from one format to another.
  • DateTimeNow(): Create a timestamp as a new attribute.

 

Articles

Handling Local Timezones, UTC, Daylight Savings Time, and Leap Unit Adjustments

Besides simple date and time conversions, the DateTimeConverter transformer can handle timezones. It can fetch the offset of zoned datetimes, remove the offset, or set an offset on an unzoned datetime. The DateTimeCalculator can be used to add or remove a single hour for daylight savings purposes. FME is also able to handle both Leap Years and Leap Seconds.

 

Working with Database Date and Time Attributes

Each database format may have its own unique structure for date and time attributes. Transformers can be used to convert strings into the format that the database expects, and to execute complex SELECT statements to work with date and time attributes.

 

Including Dates in the Names of Output Features or Files

You can include system generated time or date stamps into the names of output files or feature types by using a DateTimeStamper in conjunction with a fanout.

 

General DateTime Information and FAQs

This page answers all your questions about datetimes in FME, including what FME Hub transformers exist, where I find documentation, whether Fractional Seconds are supported, and if we will ever support Stardates!

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.