Skip to main content
Archived

DateFormatter: Expose automatically detected source date format

Related products:Transformers
  • September 15, 2016
  • 3 replies
  • 5 views

Use case: I convert dates to UNIX seconds (%s) to calculate differences, and then I may need to restore original format of the date attribute.

This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, 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

bruceharold
Contributor
Forum|alt.badge.img+17
  • Contributor
  • September 27, 2016

Hopefully the forthcoming date-handling improvements in FME 2017 will include a timedelta transformer so this use case will be satisfied.


Forum|alt.badge.img

Hi @crayxt

with FME 2017 DateTimeCalculator, you don't need to convert your dates into UNIX seconds to calculate differences.

I wonder if there are other scenarios where you would need to change datetime format and then restore the original format. In this scenarios, would you know what the original format was? Or would you rely on autodetecting the format?

Thank you in advance for your input.


revesz
Contributor
Forum|alt.badge.img+14
  • Contributor
  • April 26, 2017
It is not just converting to seconds but using Python caller (to carry out more sophisticated calculations) and formatting the calculated date/time same as the original is also useful to have the recognised format.

 

Another thing, as I'm aware DateFormatter works per feature. Let's say all locales are set to UK but I get a CSV exported from a system running on a US locale computer. '10/12/11' would be recognised as dd/mm/yy instead of mm/dd/yy but in another row 10/15/11 might be recognised correctly. It would helpful to see the recognised format as a column when debugging

 


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