Skip to main content
Solved

DateTimeConverter issue, formatting correct, but wont transform

  • August 25, 2024
  • 9 replies
  • 137 views

ecx
Supporter
Forum|alt.badge.img+4
  • Supporter



Hello, Please see picture above, DateTimeNow is my value i am feeding into DateTime attribute, which matches the preview data format, but the output keeps getting rejected saying the errors above. I’m a bit stumped to as why this is not working. Any ideas?

Thanks.

Best answer by redgeographics

frro wrote:

Hi,

I think the bug is UI related. It occurs when you apply the Datetime Attribute (in the DateTimeConverter) you get the @Value(timeAttrName) notation on the attribute. 

Hit the dot-button and select the attribute with the arrow and you should be fine.

 

Yeah, that’s definitely a bug that’s been there for a few versions and still sometimes catches me by surprise.

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

9 replies

ecx
Supporter
Forum|alt.badge.img+4
  • Author
  • Supporter
  • August 25, 2024

I managed to do this via AttributeManager with value:
@DateTimeFormat(@DateTimeNow(),%Y-%m-%d-%H-%M-%S) instead.

But I would still like to know why the above would not work. 


bwn
Evangelist
Forum|alt.badge.img+26
  • Evangelist
  • August 26, 2024

What if used a different Attribute Name as the input to DateTimeConverter instead of “DateTimeNow”?

Works for me in FME2021 by feeding a DateTimeConverter with the Date/Time value output of DateTimeStamper.   Also if I just send a value from AttributeCreator using DateTmeNow()

It could be that using an Attribute named DateTimeNow is causing an issue.  That is the same name as an FME function DateTimeNow()  That would likely trace it to a bug introduced in later FME version.


bwn
Evangelist
Forum|alt.badge.img+26
  • Evangelist
  • August 26, 2024

Sorry…...error message could also be from feeding DataTimeConverter a Feature with a Missing or Null value in an Input Feature.

It probably works with AttributeManager in the way that AttributeManager will soft fail for Missing/Null values as the input to @DateTimeFormat().   To get equivalent soft error handling in DateTimeConverter set the Parameter “Passthrough null, empties or missing” to Yes.  Can test the output of this to see that all Features process properly with a Tester with Attribute Has Value.


 


ecx
Supporter
Forum|alt.badge.img+4
  • Author
  • Supporter
  • August 26, 2024
bwn wrote:

What if used a different Attribute Name as the input to DateTimeConverter instead of “DateTimeNow”?

Works for me in FME2021 by feeding a DateTimeConverter with the Date/Time value output of DateTimeStamper.   Also if I just send a value from AttributeCreator using DateTmeNow()

It could be that using an Attribute named DateTimeNow is causing an issue.  That is the same name as an FME function DateTimeNow()  That would likely trace it to a bug introduced in later FME version.




 

I’ve also set the type to DateTime (just now, previously it was varchar), changed the column name

 

still the same output with an error. 



The tester says “fs309usg3sj30” has a value, yet when pass through null or empties missing values on the DateTimeConverter is set to yes, it passes the item through (without doing any changes)


bwn
Evangelist
Forum|alt.badge.img+26
  • Evangelist
  • August 26, 2024

Very odd.  Using the same workflow as you in FME2021 workspace works fine.    The error message is saying that an Attribute by that Name is Missing from the input Feature, even though can see on Data Inspector it clearly exists.

Maybe post up the FMW for FME’ers to see if they can replicate what looks a bit like a bug?


ecx
Supporter
Forum|alt.badge.img+4
  • Author
  • Supporter
  • August 26, 2024
bwn wrote:

Very odd.  Using the same workflow as you in FME2021 workspace works fine.    The error message is saying that an Attribute by that Name is Missing from the input Feature, even though can see on Data Inspector it clearly exists.

Maybe post up the FMW for FME’ers to see if they can replicate what looks a bit like a bug?

Thanks for giving it a go, I think it must be a bug. 

I am using version 2024.0.1.0


frro
Contributor
Forum|alt.badge.img+15
  • Contributor
  • August 26, 2024

Hi,

I think the bug is UI related. It occurs when you apply the Datetime Attribute (in the DateTimeConverter) you get the @Value(timeAttrName) notation on the attribute. 

Hit the dot-button and select the attribute with the arrow and you should be fine.

 


redgeographics
Celebrity
Forum|alt.badge.img+50
  • Celebrity
  • Best Answer
  • August 26, 2024
frro wrote:

Hi,

I think the bug is UI related. It occurs when you apply the Datetime Attribute (in the DateTimeConverter) you get the @Value(timeAttrName) notation on the attribute. 

Hit the dot-button and select the attribute with the arrow and you should be fine.

 

Yeah, that’s definitely a bug that’s been there for a few versions and still sometimes catches me by surprise.


ecx
Supporter
Forum|alt.badge.img+4
  • Author
  • Supporter
  • August 26, 2024
frro wrote:

Hi,

I think the bug is UI related. It occurs when you apply the Datetime Attribute (in the DateTimeConverter) you get the @Value(timeAttrName) notation on the attribute. 

Hit the dot-button and select the attribute with the arrow and you should be fine.

 

 


This is it! Thank you! When I hit the downward arrow and select the variable it does the @value(“variable”) rather than the actual variable, as you’ve described.

Thank you for this! 

Apologies for not selecting the right answer on your response, but the reply to it!


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