Skip to main content
Question

Why are empty values replaced with today's date in the DateFormatter

  • September 13, 2016
  • 3 replies
  • 72 views

fmelizard
Safer
Forum|alt.badge.img+22

Some of my features are sent to the DateFormatter with empty values in the formatted attribute, but they come out with today's date. Why does this happen, and how do I stop this?

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

daveatsafe
Safer
Forum|alt.badge.img+23
  • Safer
  • September 13, 2016

The DateFormatter (edit: not DateSetter) is set to use Automatic detection of the date format. When set this way, the transformer tries many different methods to produce a valid date. However one of these methods interprets a blank as the current date. To avoid this, please use specify a date format, or test for blank values before formatting.


david_r
Celebrity
  • September 14, 2016

The DateFormatter (edit: not DateSetter) is set to use Automatic detection of the date format. When set this way, the transformer tries many different methods to produce a valid date. However one of these methods interprets a blank as the current date. To avoid this, please use specify a date format, or test for blank values before formatting.

I'm guessing you meant the DateFormatter and not the DateSetter? :-)

takashi
Celebrity
  • January 14, 2017

I was not able to reproduce the issue, with FME 2016.1.3.1. e.g.

0684Q00000ArJnKQAV.png

Result: the empty attribute has not been touched, "today" has been replaced with today's date.

Attribute(encoded: utf-8): `_date_empty' has value `'
Attribute(encoded: utf-8): `_date_today' has value `20170114'
However, it seems that the DateFormatter always considers the empty string as a valid date format string. That is, the transformer does nothing for empty attributes even if you set a non-empty value or the null to the "Set Invalid Date Attributes To" parameter. I don't know if it's an intentional behavior.