Differences

This shows you the differences between the selected revisions of the page.

2014-10-10 2014-10-24
removed comma that was impeding sentence flow (23.31.143.241) 5.6.2 Bug 1223: Timestamp variable in scripting. (martin)
Line 45: Line 45:
put "%FILE_TO_UPLOAD%" put "%FILE_TO_UPLOAD%"
</code> </code>
 +
 +WinSCP automatically resolves variable ''%TIMESTAMP%'' to real time with format ''20141024161712''.((Unless the variable is already set in environment when WinSCP is started.)) You can customize the format using syntax ''%TIMESTAMP#format%'' where ''format'' may include ''yyyy'' for year, ''mm'' for month, ''dd'' for day, ''hh'' for hour, ''nn'' for minute and ''ss'' for second. For example ''%TIMESTAMP#yyyy-mm-dd%'' resolves to ''2014-10-24''.((Syntax ''%TIMESTAMP#format%'' is resolved by WinSCP to real time, even if ''%TIMESTAMP%'' variable is already set in environment when WinSCP is started.)) See [[http://docwiki.embarcadero.com/Libraries/XE6/en/System.SysUtils.FormatDateTime|other formats you can use]].
You can reference script arguments (passed on command-line using parameter ''[[commandline#scripting|/parameter]]'') using syntax ''%N%'', where ''N'' is ordinal number of argument ((Generally do surround reference by double-quotes to cope properly with spaces in its value.)): You can reference script arguments (passed on command-line using parameter ''[[commandline#scripting|/parameter]]'') using syntax ''%N%'', where ''N'' is ordinal number of argument ((Generally do surround reference by double-quotes to cope properly with spaces in its value.)):

Last modified: by martin