Solved

FME 2019 Causes Error When Writing Datetime to File Geodatabase

  • 10 July 2019
  • 2 replies
  • 112 views

Badge

While using FME 2019.0, I have noticed that I now get the following error when trying to write a datetime to a file geodatabase date field.

"An error occurred while attempting to convert the '' component of a date. A possible reason for this is that the data in the date field may be corrupt"

This is not an issue in version 2018.1 or if I write to a text field instead in the 2019 version.

I do use the following in an AttributeManager to reformat the datetime

"@DateTimeFormat(@DateTimeParse(@Value(Date_Created), %s), %Y%m%d %T)"

If I drop the "%T" part then it works but I no longer get the time which I would like to keep.

Is anyone else experiencing a similar issue and/or found any resolutions?

Regards

icon

Best answer by markatsafe 11 July 2019, 19:01

View original

2 replies

Badge +2

@potterman81 When you write a date to a format that supports a date data type, then you must use the Standard FME Date/Time Format. The format string you're using:

%Y%m%d %T will return a date time string looking like: 20190711 16:42:06

this is not a valid Standard FME Date/Time Format. If you just use @DateTimeParse(@Value(Date_Created), %s) then you'll create a date that FME can write to a date data type. Or make sure your target date field in the Geodb is a 'char'

Example workspace (created in 2018 but run in 2019.0): WritingGeodbDates.fmw

Badge

@potterman81 When you write a date to a format that supports a date data type, then you must use the Standard FME Date/Time Format. The format string you're using:

%Y%m%d %T will return a date time string looking like: 20190711 16:42:06

this is not a valid Standard FME Date/Time Format. If you just use @DateTimeParse(@Value(Date_Created), %s) then you'll create a date that FME can write to a date data type. Or make sure your target date field in the Geodb is a 'char'

Example workspace (created in 2018 but run in 2019.0): WritingGeodbDates.fmw

Thanks Mark, that did the trick. Must have been a change to how the writer works in the new version as it did work in 2018.1.

Reply