Skip to main content
Best Answer

FME 2019 Causes Error When Writing Datetime to File Geodatabase

  • July 10, 2019
  • 2 replies
  • 697 views

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

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

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
  • Author
  • July 16, 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

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.