Hello Bucket,
No way, sorry. The minus (-) operator only allow to substract seconds for a given date. Not calculate the difference between them. For example:
No way, sorry. The minus (-) operator only allow to substract seconds for a given date. Not calculate the difference between them. For example:
FTP Script
- # Get the current date in the format AAAA_MM_DD-hh_mm_ss
- # 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:
liked Script FTP? Try our other product Email Parser
I hate taking no for an answer...
FTP Script
wow
liked Script FTP? Try our other product Email Parser
It should be noted that the result will be less than 0 if the elapsed time falls over a day (0 hours being less than 23 hours). But that can be tested for and adjusted if it is important enough.
Due to some esoteric timing issues (see Timing Issues in the Bugs forum), the scriplet has changed to:
FTP Script
- :PrintElapsed
- #YYYY_MM_DD-hh_mm_ss : GETTIME(FORMAT0)
- #1234567890123456789
- # 1
- #endSeconds
- $elapsedSeconds = $endSeconds - $startSeconds
- goto :ReturnElapsed
This in one hell of a code and worth to be put in the hall of fame. Thanks.
liked Script FTP? Try our other product Email Parser
- All times are UTC -