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 11:58 AM
You need to double quote the “static text” part of your expression.
11-28-2018 12:03 PM
Again, I have done that and it is not working, I think it is cause it is being placed on a FTP server.
11-28-2018 12:18 PM
There should be a quote in the beginning (as the first character) and I don’t see it.
11-28-2018 12:56 PM
You’ll want to do something like this as the expression, but fill it in with the specifics of the hostname. As @smakkena points out, the sftp part needs to be surrounded in quotes. That creates a string that you concatenate with the Date experssion. Then you concatenate the “.txt” string on to the end.
"sftp://my.ftp.com/home/edi/BS/Trade/P41/out/filename" + Date.now().toLocaleDateTimeString({"format":"yyyyMMddHHmmss"}) + ".txt"
EDIT A colleague pointed out that the double quotes were being replaced by angled quotes by the community editor, which may also be impacting the parsing of the expression. You may need to correct that in the snap’s expression too.