Page 1 of 1

How to calculate timestamp difference

Posted: Wed Jun 03, 2015 9:45 am
by vogola
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.

Re: How to calculate timestamp difference

Posted: Fri Jun 05, 2015 11:37 am
by Support_Rick

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