In order to transfer instrument data files, I need yesterdays date as part of the file name. There is no mention, so far, of a date function that does this. I would like to be able to do something like this if the current date is 16 December 2008:
The reason I'm asking is that the example given on page 140 of the pdf manual doesn't work. For example, if I use this script
$currentdate as 2008_12_16-12_09_45 and $currentdate-1 as 2008_02_06-12_09_44;
these values for subtracting one day:
$currentdate as 2008_12_16-12_07_11 and $currentdate-(60*60*24) as 2008_02_06-12_06_47
Code: Select all
Does this capability exist?$past_file_name = TEXTCUT(GETDATE(FORMAT3-1),3,-1)."LidarData.dat"
with result of 081215LidarData.dat
The reason I'm asking is that the example given on page 140 of the pdf manual doesn't work. For example, if I use this script
Code: Select all
I get these values for subtracting one second: # Get the current date in the format AAAA_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 should print the yesterday date:
PRINT($yesterday)
$currentdate as 2008_12_16-12_09_45 and $currentdate-1 as 2008_02_06-12_09_44;
these values for subtracting one day:
$currentdate as 2008_12_16-12_07_11 and $currentdate-(60*60*24) as 2008_02_06-12_06_47
Hello strangeplant,
Does this capability exist?It exists but not with that syntax. You have to use the minus operator to substract seconds, as you have already seen in the page 140 of the pdf manual. Unfortunately this feature is not well documented, it has been added in the recent builds.
I get these values for subtracting one second:Yes, the result is completely wrong. I'll fix the bug this Friday and release a new build. I'll be out of the office tomorrow, sorry.
$currentdate as 2008_12_16-12_09_45 and $currentdate-1 as 2008_02_06-12_09_44;
these values for subtracting one day:
$currentdate as 2008_12_16-12_07_11 and $currentdate-(60*60*24) as 2008_02_06-12_06_47
liked Script FTP? Try our other product Email Parser
Hello strangeplant,
My apologies for delaying this fix so long. Download and install ScriptFTP again from here:
http://www.ScriptFTP.com/ScriptFTP_devel_setup.exe
Post here again if you find anything else, please.
My apologies for delaying this fix so long. Download and install ScriptFTP again from here:
http://www.ScriptFTP.com/ScriptFTP_devel_setup.exe
Post here again if you find anything else, please.
liked Script FTP? Try our other product Email Parser