View Full Version : how convert cdTime to TDateTime(Delphi) or CTime(VC)?
bluechos
17th of November 2003 (Mon), 00:51
hello, All !
please help me.
I taked the shooting time by SDK API
but I can not convert cdTime( this is unsigned Integer)
to Delphi Datetime or C Datetime.
How can I get the datetime?
please...
iwatkins
17th of November 2003 (Mon), 03:49
bluechos,
I can't see you getting a Date/Time from an unsigned integer (unless there is more to cdTime). More likely is that you can get a Date only.
If cdTime is a unsigned integer, probably 32-bit you are looking at using Cardinal or LongWord in Delphi (both are the same).
You can simply cast these to a TDateTime:
var
cdTime: Cardinal;
myDateTime: TDateTime;
begin
cdTime := 32767;
myDateTime := cdTime;
end;
So you could get a Date, but as I say, you won't get a time unless the cdTime unsigned integer has some kind of special decoding rules outlined in the SDK (which I don't have).
Cheers
Ian
atleypnorth
17th of November 2003 (Mon), 03:50
well since the documentation is a bit lacking ...
try FileDateToDateTime and see if it gives a sensible result
atleypnorth
24th of November 2003 (Mon), 15:28
eventually got round to looking at this ...
use UnixToDateTime
iwatkins
24th of November 2003 (Mon), 17:13
atleypnorth wrote:
eventually got round to looking at this ...
use UnixToDateTime
:) Been using Delphi since the year dot and it still surprises me with stuff I didn't know that was in there.
Cheers
Ian
vBulletin® v3.6.12, Copyright ©2000-2012, Jelsoft Enterprises Ltd.