![SoftTree Technologies](templates/GreenTech/images/logo.gif) |
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 |
|
![](templates/GreenTech/images/spacer.gif) |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7854
|
|
|
|
Here is a copy & paste from the help file (24x7 JavaScript Reference)
![](templates/GreenTech/images/code_header.gif) |
![](templates/GreenTech/images/spacer.gif) |
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 |
|
![](templates/GreenTech/images/spacer.gif) |
rhubman16
Joined: 08 Mar 2016 Posts: 41
|
|
|
|
Thank you
|
|
Fri Mar 11, 2016 1:00 pm |
|
![](templates/GreenTech/images/spacer.gif) |
|
|
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
|
|
|