Skip to main content
Solved

FME 2018 natural language dates no longer accepted

  • April 25, 2018
  • 1 reply
  • 6 views

In 2017, I would use dates like 'today', 'last month', etc in the DateFormater to create dates in FME and other formats. The new DateTimeConverter no longer recognizes natural language dates. Was this an oversight?

Best answer by takashi

Hi @sdingman, unfortunately the functionality (to convert a natural date representation to date/time value) seems to have retired in the current DateTimeFormatter. However, the functionality in the previous DateFormatter was originally from Tcl, so you can still call that with the TclCaller.

Assuming that an attribute called "_date" stores a natural date representation such as "last month", for example, this Tcl expression returns the number of seconds since the Unix epoch 1970-01-01T00:00:00Z corresponding to the date (00:00:00 local time),

clock scan [FME_GetAttribute "_date"]

and this expression returns the value formatted with a specified date/time format, e.g. "%Y%m%d".

clock format [clock scan [FME_GetAttribute "_date"]] -format "%Y%m%d"
View original
Did this help you find an answer to your question?

1 reply

takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • Best Answer
  • April 25, 2018

Hi @sdingman, unfortunately the functionality (to convert a natural date representation to date/time value) seems to have retired in the current DateTimeFormatter. However, the functionality in the previous DateFormatter was originally from Tcl, so you can still call that with the TclCaller.

Assuming that an attribute called "_date" stores a natural date representation such as "last month", for example, this Tcl expression returns the number of seconds since the Unix epoch 1970-01-01T00:00:00Z corresponding to the date (00:00:00 local time),

clock scan [FME_GetAttribute "_date"]

and this expression returns the value formatted with a specified date/time format, e.g. "%Y%m%d".

clock format [clock scan [FME_GetAttribute "_date"]] -format "%Y%m%d"

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings