Skip to main content
Question

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

  • November 13, 2020
  • 3 replies
  • 29 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

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
bwn wrote:

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.

 


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