Hi @ronaldmcoker
There is a transformer DateTimeCalculator.
It could be interesting for you.
Thanks,
Danilo
Hi @ronaldmcoker
In order to perform date calculations in FME I believe your date attribute will need to be in FME format - you can use the DateTimeConverter to do this.
You can then use the DateTimeStamper to get todays date and then use the DateTimeCalculator as mentioned already.
Alternatively you can perform date calculations in any text editor using the datetime functions. E.g in a tester set the left value to your expirydate the operator to <= and right value to:
@DateTimeAdd(@Value(_timestamp),P90D)
And the mode to Date/time. The data will then come out of the passed or failed ports accordingly.
Hi @ronaldmcoker
In order to perform date calculations in FME I believe your date attribute will need to be in FME format - you can use the DateTimeConverter to do this.
You can then use the DateTimeStamper to get todays date and then use the DateTimeCalculator as mentioned already.
Alternatively you can perform date calculations in any text editor using the datetime functions. E.g in a tester set the left value to your expirydate the operator to <= and right value to:
@DateTimeAdd(@Value(_timestamp),P90D)
And the mode to Date/time. The data will then come out of the passed or failed ports accordingly.
In a text editor select Help>Date/Time Functions for more information on how to use these
Hi @ronaldmcoker
In order to perform date calculations in FME I believe your date attribute will need to be in FME format - you can use the DateTimeConverter to do this.
You can then use the DateTimeStamper to get todays date and then use the DateTimeCalculator as mentioned already.
Alternatively you can perform date calculations in any text editor using the datetime functions. E.g in a tester set the left value to your expirydate the operator to <= and right value to:
@DateTimeAdd(@Value(_timestamp),P90D)
And the mode to Date/time. The data will then come out of the passed or failed ports accordingly.
Thanks so much. I've been messing around with this combination of transformers. I'll try this out!
Hi @ronaldmcoker
In order to perform date calculations in FME I believe your date attribute will need to be in FME format - you can use the DateTimeConverter to do this.
You can then use the DateTimeStamper to get todays date and then use the DateTimeCalculator as mentioned already.
Alternatively you can perform date calculations in any text editor using the datetime functions. E.g in a tester set the left value to your expirydate the operator to <= and right value to:
@DateTimeAdd(@Value(_timestamp),P90D)
And the mode to Date/time. The data will then come out of the passed or failed ports accordingly.
I'm not having any luck with the DateTimeStamper/DateTimeConverter/Tester combination. All outputs from DateTimeConverter are failing in the Tester, and the Failed products contain features with all dates (unfiltered).
I've attached my translation if you'd like to review (
20180710-datequeries-testing.fmw).
*****
Made some changes to Date only (instead of Datetime conversions) and changed the Tester mode to Date/Time.
"Tester(TestFactory): TestFactory: Unable to do a date/time comparison of '20120527' and 'DateTimeAdd(20180711, P90D)'. Comparing as strings instead"
Hi @ronaldmcoker
In order to perform date calculations in FME I believe your date attribute will need to be in FME format - you can use the DateTimeConverter to do this.
You can then use the DateTimeStamper to get todays date and then use the DateTimeCalculator as mentioned already.
Alternatively you can perform date calculations in any text editor using the datetime functions. E.g in a tester set the left value to your expirydate the operator to <= and right value to:
@DateTimeAdd(@Value(_timestamp),P90D)
And the mode to Date/time. The data will then come out of the passed or failed ports accordingly.
Hi @ronaldmcoker
For the date/time functions to work they need to be preceded by @ . Instead of typing this in by hand in the text editor you can add these functions from the menu on the left hand side - please see picture attached.

Hi @ronaldmcoker
For the date/time functions to work they need to be preceded by @ . Instead of typing this in by hand in the text editor you can add these functions from the menu on the left hand side - please see picture attached.

@hollyatsafe I think that did it! Thank you!