11-28-2018 08:48 AM
Hello,
I am trying to figure out the time stamp features, and I can’t seem to get it to work.
I have on my file writer: “XXXXXXX_” + Date.now() + .txt
But that doesn’t work, Can someone inform me on what I need to do to correct this and get this to work? I want to have YYYYMMDDHHMMSS in the time stamp.
11-28-2018 10:20 AM
If you change the expression to this then you’ll get close. [note: I quoted the .txt]
Expression: “XXXXXXX_” + Date.now() + “.txt”
Result: XXXXX_2018-11-28T18:10:54.456Z.txt
You could further format the date by doing.
Expression: “XXXXXXX_” + Date.now().toLocaleDateTimeString({“format”:“yyyyMMddHHmmss”}) + “.txt”
Result: XXXXX_20181128181830.txt
Here is more documentation on the toLocaleDateTimeString.
11-28-2018 11:28 AM
Okay, I have tried both ways you have and it is still messing up. to give further explaination, my file name is a directory path to our FTP server and then the name. so for example. it is something like this…
/home/edi/BS/Trade/P41/out/“filename” + Date.now().toLocaleDateTimeString({“format”:“yyyyMMddHHmmss”}) + “.txt”
An on the server it is literally posting that as the name ^^
11-28-2018 11:50 AM
I am guessing you do NOT have the expression toggle on for the File name property…causing it to treat the value as literal text.
11-28-2018 11:56 AM
That makes it fail when I have it as an expression. Since it is on a server could that be an issue.