I have a datetime in the format YYYYmmddHHMMSS.SSS and want to convert it to any other format e.g. YYYYmmdd or DD-MM-YY or whatever.
My super simple workspace is below.
My FME version is Windows 2022.1.3.0
The DateTimeConverter version is 4
The result I get with every combination is INVALID_INPUT
The Preview suggests everything is OK and what I expect:
Any suggestions?
Best answer by danminneyatsaf
danminneyatsaf wrote:
Hi @Arnold Bijlsma I was able to successfully change the value with the DateTimeConverter. What version of FME Desktop are you running? For context I am using FME(R) 2022.2.0.0 (20221103 - Build 22765 - WIN64).
If you're using an older version of FME Desktop then I suspect this was a bug that has since been resolved. I've also attached a copy of my workspace for your reference.
@Arnold Bijlsma In this case, you can click the drop-down arrow next to "Preview Data" and input your input data manually. FME tries its best to account for all possible formats of input data, but it looks like in this case the DateTimeConverter hasn't been able to parse the ' %I:%M %p' format.
I've also submitted a ticket to our developers to see if we can get this changed so that the %m/%d/%y2100 %I:%M %p format is supported with the DateTimeConverter Preview. The ticket number is FMEDESKTOP-13922. We will update you here if a fix is released.
I believe this should be reported as a bug, using the down arrow and selecting the field should insert the attribute in the same way as clicking the three dots and selecting the field. And it does in previous versions of the DateTimeConverter
@geographix Thanks for bringing this bug to our attention. This looks to be an issue with the DateTimeConverter GUI, so I've gone ahead and submitted a bug report to get this fixed. The issue number is FMEDESKTOP-13351. We will notify everyone here once a fix is released in a new version of FME. Thanks for your understanding.
Hi everyone, a fix for this bug is now available in the current 2023 beta version, and will be included in the full FME 2023 release. Thanks for your patience ! 😄
@danminneyatsaf : Not sure if this is related to the above, or if it's a different bug, but the DateTimeConverter is unable to pick up a datetime like "05/27/16 06:39 AM". As far as I understand, the Input Format on the transformer should be "%m/%d/%y2100 %I:%M %p". But the Preview says it's an error, and running it also tells me it's an Invalid Format.
When I use the @DateTimeParse function instead, it does work perfectly though!
@danminneyatsaf : Not sure if this is related to the above, or if it's a different bug, but the DateTimeConverter is unable to pick up a datetime like "05/27/16 06:39 AM". As far as I understand, the Input Format on the transformer should be "%m/%d/%y2100 %I:%M %p". But the Preview says it's an error, and running it also tells me it's an Invalid Format.
When I use the @DateTimeParse function instead, it does work perfectly though!
Happy to log a different ticket.
Hi @Arnold Bijlsma I was able to successfully change the value with the DateTimeConverter. What version of FME Desktop are you running? For context I am using FME(R) 2022.2.0.0 (20221103 - Build 22765 - WIN64).
If you're using an older version of FME Desktop then I suspect this was a bug that has since been resolved. I've also attached a copy of my workspace for your reference.
Hi @Arnold Bijlsma I was able to successfully change the value with the DateTimeConverter. What version of FME Desktop are you running? For context I am using FME(R) 2022.2.0.0 (20221103 - Build 22765 - WIN64).
If you're using an older version of FME Desktop then I suspect this was a bug that has since been resolved. I've also attached a copy of my workspace for your reference.
@danminneyatsaf I was using 2022.1.2, and found the same issue as above that it failed when you fill in the "Datetime Attributes" parameter the usual way, because it will say "@Value(DateFieldName)". Manually removing the @Value and the brackets, so it just says "DateFieldName" (as @david_r mentioned at the beginning) does work. And that bug has indeed been fixed in FME 2022.2+
In other words, the issue is/was not in the "Input Format" parameter (as I thought) but in the "Datetime Attributes" parameter.
The only minor issue is that the Preview box still doesn't like it (and which explains why I blamed the "Input Format" parameter for my features getting all rejected)
Hi @Arnold Bijlsma I was able to successfully change the value with the DateTimeConverter. What version of FME Desktop are you running? For context I am using FME(R) 2022.2.0.0 (20221103 - Build 22765 - WIN64).
If you're using an older version of FME Desktop then I suspect this was a bug that has since been resolved. I've also attached a copy of my workspace for your reference.
@Arnold Bijlsma In this case, you can click the drop-down arrow next to "Preview Data" and input your input data manually. FME tries its best to account for all possible formats of input data, but it looks like in this case the DateTimeConverter hasn't been able to parse the ' %I:%M %p' format.
I've also submitted a ticket to our developers to see if we can get this changed so that the %m/%d/%y2100 %I:%M %p format is supported with the DateTimeConverter Preview. The ticket number is FMEDESKTOP-13922. We will update you here if a fix is released.
Hi @Arnold Bijlsma I was able to successfully change the value with the DateTimeConverter. What version of FME Desktop are you running? For context I am using FME(R) 2022.2.0.0 (20221103 - Build 22765 - WIN64).
If you're using an older version of FME Desktop then I suspect this was a bug that has since been resolved. I've also attached a copy of my workspace for your reference.
I’m happy to update that the ticket that @danminneyatsaf had filed has been addressed for FME 2024.1! At the moment, the new functionality is only available in our FME 2024.1 beta.
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.