 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
rhubman16
Joined: 08 Mar 2016 Posts: 41
|
|
Check FTP file date |
|
How can I check to see if a file on a FTP server is dated today?
I know I can use FTPFileDateTime to get the date of the file but how do I do the if statement to check if it is from today?
Thank you in advance for any help.
|
|
Fri Mar 11, 2016 10:53 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
Here is a copy & paste from the help file (24x7 JavaScript Reference)
 |
 |
Date d = FTP.fileDateTime("my server", "test_user5", "test password", "/pub/1.txt");
var str = "Date is " + d.getMonth() + "/" + d.getDate() + "/" +
d.getYear() + "/" + d.getHour() + ":" + d.getMinute() + ":" +
d.getSecond();
Scheduler.messageBox(str); |
You can use it as a basis. Compare the returned file date to today's system date, and if they are the same, do what you need to do in that case.
|
|
Fri Mar 11, 2016 11:50 am |
|
 |
rhubman16
Joined: 08 Mar 2016 Posts: 41
|
|
|
|
Thank you
|
|
Fri Mar 11, 2016 1:00 pm |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|