login about faq

I am setting the UtcMode to True on the sftp component, but regardless of the setting it is returning the LastModified timestamp as local time.

Here's the relevant part of the LastErrorText after the directory listing. The lastModifiedTime32 shown there unpacks to 2013-04-10 16:07:59 GMT. But regardless of the UtcMode setting, SFtpFile.LastModifiedTime returns it as 2013-04-10 12:07:59, which is the localized time.

If I call GetLastModifiedDt().GetAsDateTime(false), it returns the correct time, but the year is wrong as in my earlier post today about the ftp component: the year is "0413" instead of "2013"

    DllDate: Dec 12 2012
    UnlockPrefix: ****
    Username: ****
    Architecture: Little Endian; 64-bit
    Language: .NET 4.0 / x64
    VerboseLogging: 1
    SshVersion: SSH-2.0-5.17 FlowSsh: Bitvise SSH Server (WinSSHD) 5.60
    SftpVersion: 3
    handle: 0005
      packetType: SSH_FXP_READDIR
        sendMessage: CHANNEL_DATA
    loopIdx: 1
      readChannelData: chan=0; tmOutMs=0; checkQ=1; onlyExt=0; skipExt=1; idleTmOutMs=0; bOneRaw=0
        packetLen: 540
        mType: CHANNEL_DATA
        payload: msgType=94; len=521
    packetType: SSH_FXP_NAME
      filename: t123456.txt
      validFlags: 0xd
      size: 33
      permissions: 0x81b0
      octalPermissions: 100660
: 1
      lastAccessTime32: 0x5165c855
      lastModifiedTime32: 0x51658e5f

asked Apr 10 '13 at 17:16

WilliamW's gravatar image


edited Apr 10 '13 at 17:26

I originally said that GetLastModifiedDt returned the correct value. It does not--it returns the correct time, but the year is wrong (0413 instead of 2013).

(Apr 10 '13 at 17:28) WilliamW


answered Apr 11 '13 at 09:27

chilkat's gravatar image

chilkat ♦♦

GetLastModifiedDt.GetAsDateTime now returns the correct value and timezone offset, so I can use that. LastModifiedTime still returns a value in the local timezone.

(Apr 11 '13 at 10:59) 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 17:16

Seen: 1,220 times

Last updated: Apr 11 '13 at 10:59

powered by OSQA