How to ftp a File and Make Today's Date File Rename
Keywords: TimeJulianDay
Question:
Does anybody have any idea on how I can download a weekly file from an ftp site where the filename changes every week based on the current date?For example:
This week monday was Nov 17; so the filename would be 1117.exe.
Is there a way to get the date somehow from windows and import that into the filename and then use netscape to download the file?
Answer:
- Use the Internet Extender to download the file for you.
- Part of the trick is figuring out the filename you want.
;Get date in Julian format Today=TimeYmdHms() TodayJulian=TimeJulianDay(Today) ;Figure out day of week Day=(TodayJulian+5) mod 7 ;0=Sunday 1=Mon 6=Sat ;Adjust day number to days ;from Monday DaysFromMonday=(Day+6) mod 7 MondayJulian=TodayJulian - DaysFromMonday Monday=TimeJulToYmd(MondayJulian) monthnum=ItemExtract(2,Monday,":") daynum=ItemExtract(3,Monday,":") myfilename=strcat(monthnum,daynum,".exe") Message("Monday's Filename is",myfilename)
Article ID: W12647Filename: How to FTP a File and Rename it with Todays Date.txt