PDA

View Full Version : SDK - format of cdTime type...


caunt
2nd of August 2003 (Sat), 11:50
Hello folks,
I'm using sdk6 with Delphi (which is unsupported, but includes most needed files). The trouble is, I can't figure out the format they are using for date/time.
(eg. in cdIMG_PROP_CAPTURE_TIME)
The base format is an unsigned 32bit integer, but HOW does canon format this into a date/time?

For example, I know that 1058764840 represents
20 Jul 2003 21:20:42, but how do I get from the integer to the date?

None of the date/time formats I've tried works correctly! (I've tried about 8).

In Addition, since I also know that
1058821650 = 21 Jul 2003 13:07:31 and
1058821658 = 21 Jul 2003 13:07:40
I'm guessing that the first 5 digits deal with day and the last 5 with time. Can someone please help me out with the rest ?

caunt
3rd of August 2003 (Sun), 17:16
Ok, if anyone else reads this, here's the answer:

Canon stores time as the number of seconds elapsed since midnight, January 1, 1970...Universal time.

The 8 hours difference in the example in my origional post is because the time is stored as universal time (8 hours ahead of me). It just requires adjustment for time zones!

I even found a university site that described the format Canon is (apparently) using rather succintly:

type time_t is defined to be a long integer (i.e. long int). A variable of this type will hold the number of seconds (after a call to function time - discussed below) since midnight (00:00:00), January 1, 1970, coordinated universal time, according to the system clock

Now why couldn't Canon mention this?

fhooper
4th of August 2003 (Mon), 10:18
The time format is the same as Unix systems time variable.

check the man pages for unix time systems calls, and you will see the description.