PDA

View Full Version : Compiled Time stamp for name


ehigginbotham
July 22nd, 2012, 09:14 AM
I need to write a rule that will name my output file with a static name followed by the date. I would like to add a time stamp to the end of the date so that if I had to run two of these jobs in the same day, the files would not overwrite. I do not see any code for the timestamp. Anyone know what it is?


my date rule
//date rule
var todaysdate = Today();
return (FormatDate(todaysdate, "mmm dd, y"));


my rule so far is on the OnNewoutputfile callback rule.

//NewOutputFileName rule
FusionPro.Composition.outputFileName = "MKT-271/MKT-271" +"_"+ Rule("r_date") + ".pdf";


thanks

clboehm
July 23rd, 2012, 06:37 AM
Hi Eric,

Try this:
var todaysdate = Today();
return (FormatDate(todaysdate, "mm/dd/y - HH:MM:ss"));

Dan Korn
July 23rd, 2012, 08:08 AM
It's actually "nn" for minutes. The full documentation is here:
http://forums.pti.com/showpost.php?p=195