How can i get ftp server time using vb.net code ?

How can i get ftp server time using vb.net code?
x1877Asked:
Who is Participating?
 
L00MCommented:
I don't believe there are any ftp commands to  retrieve the remote server time. I believe the work around would be to upload an empty text file. You coukld then DIR on that directory and parse out the file creation time. Or possibly download the file back to your computer and I think it will keep the server's creation time. Again you could parse out the creation time. I've never done this, so it will take some experimentation on your part. But I believe this should work.
0
 
L00MCommented:
Is this a local ftp server? Or did you want to get the time off of a remote ftp server?
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
x1877Author Commented:
Hi L00M:

Thanks for your response. Its a remote ftp server.
0
 
x1877Author Commented:
You are right. I did it that way. Small difference, i created a folder insted and checked its creation time. I feel its an ugly way but cant help!!. There could be scinarios the ftp user does not have the permission to create or upload anything to the ftp server but can read. If you come acros anything else let me know. Again thanks for your response.
0
 
L00MCommented:
Yeah, if you will be dealing with multiple unknown servers, then there is no sure fire way I know of. If you need this only on a few known servers, and you have access to them, then you could create a web service or similar to return the time to you as needed. Then, your machine could ping those servers periodically and store the difference between your local time and the remote machine's time in a database. Then, with some basic math, you'd know the server time +/- a second or so.
I'll keep my eye open for more solutions.
0
 
L00MCommented:
Any paticular reason you gave me a B? EE Help states:

B: The Expert(s) provided an acceptable solution, or a link to an acceptable solution, that you were able to use, although you may have needed a bit more information to complete the task.

If you required more information, you should have asked. If you felt you deserved a refund, you could have (and still can) asked for that under community support. If you are unsure which grade to give, reference:
http://www.experts-exchange.com/help.jsp#hi73
0
 
x1877Author Commented:
Hi Loom,
How are you? Hope you are doing fine.

Infact i needed a solution which works always.

In this case i have to work with many unknown ftp servers. There is no way i can create a webservice or put an asp page on them.

This solution can still fail if the ftp user does not have a write permission to the ftp server.

So that is why i decided to award grade B for this answer.  Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.