login about faq

The Last Modified timestamp being reported by the ftp2 component is incorrect. It looks like the component is defaulting a timezone offset of -12 hours for the value it gets back from the server.

Here is the directory listing as shown in the SessionLog:

(DirListingCharset: utf-8)
read listing success = 1, listing size = 242
04-01-13  02:43PM       <DIR>          ftpuser
03-28-13  02:12PM       <DIR>          source
03-29-13  11:36AM       <DIR>          source2
03-30-13  03:57PM       <DIR>          target
04-10-13  12:07PM                   33 t123456.txt
226 Transfer complete.

When I retrieve the timestamp for the "t123456.txt" file, I get these results, none of which is correct:

GetLastModifiedTimeStr: Thu, 11 Apr 2013 00:07:00 -0400
GetLastModDt.GetAsDateTime(false): 4/11/0413 4:07:00 AM
GetLastModDt.GetAsDateTime(true): 4/11/0413 12:07:00 AM
GetLastModifiedTime: 4/11/2013 12:07:00 AM

The CkDateTime returned by GetLastModDt has a UTC offset of -14400.

It seems like the component should just be reporting back the value it gets from the server without doing timezone interpretation, since timezone information isn't reported by the server.

Note that the calls to GetLastModDt.GetAsDateTime are returning a DateTime value that has the wrong year (0413).

asked Apr 10 '13 at 12:57

WilliamW's gravatar image


edited Apr 10 '13 at 12:58

This is probably a problem that is fixed in the latest pre-release. I can provide a new build for testing, however, I don't know your programming language, operating system, platform (32-bit/64-bit), if Windows, then .NET Framework version? MSVC++ version, etc.?


answered Apr 11 '13 at 08:29

chilkat's gravatar image

chilkat ♦♦

I'm using the .NET 4 version, 32- and 64-bit.

(Apr 11 '13 at 08:47) WilliamW

Problem with CkDateTime producing invalid DateTimes is corrected, but timestamp from ftp is still 12 hours ahead of what it should be.

(Apr 11 '13 at 10:39) WilliamW

I'm not sure what's going on anymore. The one file I was testing with yesterday is still getting the wrong timestamp, but others appear to be getting the correct result.

(Apr 11 '13 at 11:43) WilliamW

See the answer here: http://www.chilkatforum.com/questions/3020/ftpsftp-timestamps

Also, make sure you are using the latest version of Chilkat, just in case there were problems relating to this topic that have been fixed.


answered Apr 10 '13 at 18:43

chilkat's gravatar image

chilkat ♦♦

I'm using the version from Dec 12 2012. Sorry I didn't notice the other question. I guess I didn't search again today after I originally looked into this a few days ago.

I assumed the LastModification date comes from parsing the directory listing returned by the server rather than from MDTM. I called NumFilesAndDirs, then processed the directory listing.

(Apr 10 '13 at 21:09) WilliamW

What I need is a timestamp that I know how to interpret. If it's sometimes coming from the directory listing that's in local time on the server, that's fine--I can ask the user to tell me what timezone the server is in, or try to work it out by uploading a file and checking the date afterward. If it comes from MDTM and is in UTC, that's great. But if it can be either, then I need a way to know which one it is.

(Apr 10 '13 at 21:09) WilliamW

Based on what you said in the other question, it sounds like if all I've done is a directory listing, then the timestamp I get will always be from the directory listing (not MDTM) and therefore, once I correct for the -14400 offset, will be "local" time on the server. Is this correct?

(Apr 10 '13 at 21:09) WilliamW

At any rate there seems to be a separate problem with CkDateTime.GetAsDateTime returning an invalid year.

(Apr 10 '13 at 21:10) WilliamW

Just looked at UtcOffset again and realized things don't add up the way I thought they did. CkDateTime is reporting -14400, which is -4 hours (which is the correct offset for my local TZ, and the server TZ in this case). But the values being reported for the timestamp are 12 hours ahead of what they should be.

(Apr 10 '13 at 21:50) WilliamW
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Apr 10 '13 at 12:57

Seen: 1,655 times

Last updated: Apr 11 '13 at 11:43

powered by OSQA