Script

FTP

The professional tool to automate FTP, SFTP, FTPS

and schedule FTP batch jobs

  • Home

  • FORUM INDEX
Post a message here if you find anything wrong in ScriptFTP.
 #14926  by gizquier2
 17 Jan 2017, 20:33
When you do this instead of print 2017_01_16 print 2017_1_16-
FTP Script
  1. # Get the current date in the format YYYY_MM_DD-hh_mm_ss
  2. $currentdate=GETDATE(FORMAT0)
  3.  
  4. # Then, you can substract or add seconds to that date stored
  5. # in the variable. Yesterday is:
  6. $yesterday=$currentdate-(60*60*24)
  7. # (3600*60*60) is the amount in seconds in a day.
  8.  
  9. # This shold print the yesterday date:
  10. PRINT($yesterday)
 #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 563 times
 #15006  by ScriptFTP support
 06 Jul 2017, 18:24
Yes, correct. Disregard my last response. This has been fixed in the new 4.3 beta version. It can be downloaded from here. (sorry, no link)

https://www.ScriptFTP.com/beta
-->