Skip to main content
Question

Automatic populate <CreateTime> in the XMLTemplater transformer


galigis
Enthusiast
Forum|alt.badge.img+20

Hi All,

 

I have put a workbench together to populate some GIS metadata but I need to have the <CreateTime> automatically populate every time I run the workbench, below an example of the XMLTemplater transformer settings:

FME_3Currently the time if fixed as 00:00:000, How can I set it as variable parameter ? I have tried the ROOT Template Functions but didn't work.

 

Any advise more than welcome :)

Thanks

 

2 replies

takashi.pss
Contributor
Forum|alt.badge.img+3
  • Contributor
  • November 21, 2023

Hi @galigis​ ,

You can use Date/Time functions in an XML Template expression to get the current time and convert it to a preferable format. e.g.

<root>
    <CreateTime>@DateTimeFormat(@Left(@DateTimeNow(),14),%H:%M:%S)</CreateTime>
</root>

 


galigis
Enthusiast
Forum|alt.badge.img+20
  • Author
  • Enthusiast
  • November 21, 2023

Bravo! Sorted, thanks :)


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