SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Check FTP file date

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Check FTP file date
Author Message
rhubman16



Joined: 08 Mar 2016
Posts: 41

Post Check FTP file date Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7838

Post Reply with quote
Here is a copy & paste from the help file (24x7 JavaScript Reference)


Code:

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 View user's profile Send private message
rhubman16



Joined: 08 Mar 2016
Posts: 41

Post Reply with quote
Thank you
Fri Mar 11, 2016 1:00 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
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


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.