Skip to main content
Question

@DateTimeFormat in FeatureWriter with multiple sheets


galigis
Enthusiast
Forum|alt.badge.img+20

Hi All,

 

How can I force FME to write a single excel file with an unique DateTime value for all the Excel sheets included in a FeatureWriter? see the details below:

image 

Atm FeatureWriter writes a 'datetime' per excel sheet therefore export multiple xlsx instead of one single excel file.

 

Any ideas? 🙂

 

 

 

 

3 replies

nielsgerrits
VIP
Forum|alt.badge.img+54

When I need this, I create a Scripted Parameter. (Navigator, User Parameters)

This works:

import datetime
 
timestamp = datetime.datetime.now().strftime("%H_%M_%S")
return timestamp

 


galigis
Enthusiast
Forum|alt.badge.img+20
  • Author
  • Enthusiast
  • December 15, 2023

Bravo! thanks @nielsgerrits​ :)


redgeographics
Celebrity
Forum|alt.badge.img+50
galigis wrote:

Bravo! thanks @nielsgerrits​ :)

To elaborate on @nielsgerrits​ answer: the @DateTimeNow() function gets evaluated per feature, so each feature will have a slightly different timestamp. Despite rounding it to seconds you'll still potentially get multiple values


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