Skip to main content

Dear FME community.

I've to use the dynamoDB connector with a partition key like a specific date (for example : today - 5 days).

For that I only can using a published parameter :

But in this case I don't have access to the date function :

Do you know how can I do that ?

For information, I've FME Server.

Thank you for your help.

If you need today's date minus 5 days, you can use a private scripted Python parameter:

0684Q00000ArLFLQA3.png

import datetime
today = datetime.datetime.now()
five_days_ago = today - datetime.timedelta(days=5)
return five_days_ago.strftime('%Y-%m-%dT%H:%M:%S%Ez')

To avoid considering the time of day, replace the last line with:

return five_days_ago.strftime('%Y-%m-%dT00:00:00+00')

You can then reference $(FIVE_DAYS_AGO) in the FeatureReader / reader.


If you need today's date minus 5 days, you can use a private scripted Python parameter:

0684Q00000ArLFLQA3.png

import datetime
today = datetime.datetime.now()
five_days_ago = today - datetime.timedelta(days=5)
return five_days_ago.strftime('%Y-%m-%dT%H:%M:%S%Ez')

To avoid considering the time of day, replace the last line with:

return five_days_ago.strftime('%Y-%m-%dT00:00:00+00')

You can then reference $(FIVE_DAYS_AGO) in the FeatureReader / reader.

It's perfect !

Thanks @david_r !


Reply