Skip to main content
Solved

FME 2019 Causes Error When Writing Datetime to File Geodatabase


Forum|alt.badge.img

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

Best answer by markatsafe

@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

View original
Did this help you find an answer to your question?

2 replies

Forum|alt.badge.img+2
  • Best Answer
  • July 11, 2019

@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


Forum|alt.badge.img
markatsafe wrote:

@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


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