How to calculate timestamp difference

Post any question you may have in regards to GoAnywhere Director and let our talented support staff and other users assist you.
2 posts Page 1 of 1

vogola

Posts: 2
Joined: Thu Nov 29, 2012 11:59 am

Post by vogola » Wed Jun 03, 2015 9:45 am
I need to determine the timestamp difference between a local file and a server file. The transfer of a local file shall depend on a certain result of the calculation of timestamp local minus timestamp server.

In my project I use

${FileInfo("resource:smb://folder/file.csv"):lastModifiedMillis()} - ${CurrentTimeMillis()} for the local file.

Support_Rick

Support Specialist
Posts: 590
Joined: Tue Jul 17, 2012 2:12 pm
Location: Phoenix, AZ

Post by Support_Rick » Fri Jun 05, 2015 11:37 am
vogola,

The Pseudo breakdown would be something like this...

Make the connection to your Remote Server and create a FileList var (RmtFiles) of the files you need to test. -- Or, you could get the files and generate a FileList var --

Loop through the RmtFiles FileList var
Get the lastModifiedDate (FileInfo) of the RmtFile
Find and get the corresponding lastModifiedDate (FileInfo) of the Local File to compare
Do Comparison of the 2 Dates
Function according to value
EndLoop
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
2 posts Page 1 of 1