Script

FTP

The professional tool to automate FTP, SFTP, FTPS and Batch FTP

  • Home

  • FORUM INDEX
Post a message here if you find anything wrong in ScriptFTP.
 #14926  by gizquier2
 17 Jan 2017, 20:33
[scriptftp]# Get the current date in the format YYYY_MM_DD-hh_mm_ss
$currentdate=GETDATE(FORMAT0)

# Then, you can substract or add seconds to that date stored
# in the variable. Yesterday is:
$yesterday=$currentdate-(60*60*24)
# (3600*60*60) is the amount in seconds in a day.

# This shold print the yesterday date:
PRINT($yesterday)[/scriptftp]

When you do this instead of print 2017_01_16
print 2017_1_16-
 #14927  by ScriptFTP support
 18 Jan 2017, 19:09
Hi,

It should print the date along with the time(for example 2017_1_17-20_15_54). I have tested the script with the latest version and it correcly shows the time of yesterday substracting 24 hours to the current time. See the screenshot:
yesterday_date_ftp_script.jpg
yesterday_date_ftp_script.jpg (47.78 KiB) Viewed 98 times
-->