How to convert a date variable to string "yyyymmdd"


#1

As subject, how can I get a string variable with string variable to display current date as “yyyymmdd” format?
For example, the variable for today should be “20171203”


#3

@yy_shaPcUgrEJo,

currently there is no single action for this type of conversion. It is planned for the next release.

Meanwhile you can do something like this:

new-rec.zip (32.1 KB)


#4

Get it! Thanks with the help.


#5

I tried this solution, but the didnt worked in Control Tower. Error was groovy.lang.MissingMethodException.

Can anybody help me get out of this


#6

I think can’t copy all. different computer has different date format.
but the concept is to copy to clipboard, and then transfer to a string variable, then adjust the date format.


#7

I used python to format time, you can copy the following command:

    import pyperclip,datetime
    pyperclip.copy(datetime.datetime.now().strftime("'%Y%m%d'"))

save to a py file-gettime.py and then create a bat file:
python gettime.py
at last, run the bat file and set the clipboard to a variable
but at first, you need to install python