Skip to main content
Question

How to add a private parameter "Date" to a reader source

  • November 13, 2020
  • 3 replies
  • 46 views

Forum|alt.badge.img

Trying to add a date parameter to a reader's source URL in the mm/dd/yyyy format for today's date

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.

3 replies

bwn
Evangelist
Forum|alt.badge.img+26
  • Evangelist
  • November 14, 2020

Try:

@DateTimeFormat($(MyDateParameter),%m/%d/%Y)

See FME Date/Time Functions help for further reference:

https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_ReadersWriters/!Transformer_Parameters/Date-Time-Functions.htm

 


bwn
Evangelist
Forum|alt.badge.img+26
  • Evangelist
  • November 15, 2020

Try:

@DateTimeFormat($(MyDateParameter),%m/%d/%Y)

See FME Date/Time Functions help for further reference:

https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_ReadersWriters/!Transformer_Parameters/Date-Time-Functions.htm

 

Just re-read the bit about this being today's date.   You strictly speaking don't need a Parameter to do this for the Reader Source string.   The above formula could be rewritten as:

@DateTimeFormat(@DateTimeNow,%m/%d/%Y)

So the Source URL can be written to be evaluated as:

http://mywebdatasource.com/date@DateTimeFormat(@DateTimeNow,%m/%d/%Y)

Or whatever URL string parsing is required.

 


david_r
Celebrity
  • November 16, 2020

An alternative is to replace the reader with a FeatureReader transformer. You can then start the workspace with a Creator and follow up with a DateTimeStamper (and DateTimeConverter, if necessary) before passing it on to the FeatureReader as a part of the URL.