Skip to main content
Solved

How to convert string to date format in FME?

  • January 5, 2023
  • 4 replies
  • 1536 views

smfks911

Happy New Year all.

 

Can anyone please how can I change a date column (dd/mm/yyyy) from string to date time format within a workbench. The column is originally coming from a CSV file but after reading in FME, its getting converted into string. I want to apply test filter to get values within a certain date period but because the date is in string, I cannot do it. Do you have any idea how to resolve the issue? Thanks in advance.

Best answer by geomancer

Take a look at the DateTimeConverter.

DateTimeConverter

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.

4 replies

geomancer
Evangelist
Forum|alt.badge.img+58
  • Evangelist
  • 932 replies
  • Best Answer
  • January 5, 2023

Take a look at the DateTimeConverter.

DateTimeConverter


ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3422 replies
  • January 5, 2023

You can also parse the string to a date within an AttributeCreator/AttributeManager

@DateTimeParse(@Value(date),%d/%m/%Y)

 


smfks911
  • Author
  • 46 replies
  • January 5, 2023

Take a look at the DateTimeConverter.

DateTimeConverter

Thank you @geomancer​ . I later avoided the problem by converting CSV to Excel from the source. And in ExcelReader, the field does not change interestingly.


smfks911
  • Author
  • 46 replies
  • January 5, 2023

You can also parse the string to a date within an AttributeCreator/AttributeManager

@DateTimeParse(@Value(date),%d/%m/%Y)

 

Thank you @ebygomm​ :)