Skip to main content
Question

Date formatting issues

  • March 7, 2018
  • 3 replies
  • 177 views

Forum|alt.badge.img

Good morning i have been having a perplexing issue when writing a date to tab and shape. (FME 2015.1.1.0 build 15515, date formatter version 3)

From my source data my date is coming though as a string YYYYMMDDHHSSSSSS and using the date formatter it’s a simple matter to turn the date into YYYY-MM-DD.

I check It is changing the date correcting via an inspector on the formatter and it is writing correctly.

The issue is that when I write to a shape or tab output with the field type to set to date the data will not write correctly, Ie I get a null attribute.

If I write the date YYYYMMDD then the attribute is written correctly.

If I change the shape table field type to char then the YYYY-MM-DD then the date is written correctly.

This is very perplexing…

Cheers

Q

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.

3 replies

takashi
Celebrity
  • 7843 replies
  • March 7, 2018

FME treats date values as character strings while translating, and usually FME writers translate a date string with FME Standard Date format i.e. YYYYMMDD into the appropriate date type value in the destination data format automatically. You don't need format the date value to a specific format (e.g. YYYYY-MM-DD) before writing.


Forum|alt.badge.img
  • 275 replies
  • March 8, 2018

Just to add to @takashi's comment: I believe, TAB and Shape will display dates in system locale format.

 


farfar
Contributor
Forum|alt.badge.img+12
  • Contributor
  • 41 replies
  • March 8, 2018

verify that your field into shp (or TAB) file has "char" format (and not has a "date" format)