login about faq

I am using FTP2 with Delphi Dll. How do I convert the value of CkFtp2_GetLastModDt() to String or TDateTime ?

asked Jul 14 '13 at 03:30

AllanF's gravatar image

AllanF
1334


To get it as a string in RFC822 format, you would instead call CkFtp2__getLastModifiedTimeStr. Notice that each function that returns a string has two forms. One has a double underscore followed by the lowercase function name and returns the string directly. The other has a single underscore and uses the uppercase name, and returns the string in a HCkString. This is the convention for all Chilkat DLL functions that return strings:

function CkFtp2__getLastModifiedTimeStr(objHandle: HCkFtp2; 
    index: Integer): PWideChar; stdcall; 

function CkFtp2_GetLastModifiedTimeStr(objHandle: HCkFtp2; index: Integer; outStr: HCkString): Boolean; stdcall;

link

answered Jul 15 '13 at 11:09

chilkat's gravatar image

chilkat ♦♦
11.8k316358420

edited Jul 15 '13 at 11:10

The CkFtp2_GetLastModDt method returns a CkDateTime object via a handle (HCkDateTime). At the moment I'm writing this, I don't know how to get it as a TDateTime, but this is what you would do (and I'm about to do it...) You first look at the HCkDateTime API to see what date/time representations it is capable of returning, and then you look at the TDateTime documentation to see what date/time formats/representations it's capable of using for setting or creating an object instance. If you find a common format, then you would get the date/time in that format from HCkDateTime, and use it to load/set/create a TDateTime object.

link

answered Jul 15 '13 at 11:14

chilkat's gravatar image

chilkat ♦♦
11.8k316358420

Apparently TDateTime is a double. (See http://www.delphibasics.co.uk/RTL.asp?Name=TDateTime )

(Jul 15 '13 at 11:16) chilkat ♦♦

When a date/time is represented as a "double", it's an OLE date/time representation (This is the DATE type used in VB6 or ActiveX.)

You can get the date/time as a double from the HCkDateTime object via the CkDateTime_GetAsOleDate function:

function CkDateTime_GetAsOleDate(objHandle: HCkDateTime; 
    bLocal: Boolean): Double; stdcall; 

(Jul 15 '13 at 11:18) chilkat ♦♦

Thanks this solution is perfect.

CkDateTime_GetAsOleDate(CkFtp2_GetLastModDt(ftp,i),True)

(Jul 16 '13 at 00:39) AllanF
Your answer
toggle preview

Follow this question

By Email:

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

By RSS:

Answers

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

Tags:

×131
×56

Asked: Jul 14 '13 at 03:30

Seen: 1,001 times

Last updated: Jul 16 '13 at 00:39

powered by OSQA