Subject | Re: [ib-support] Format of ISC_TIME |
---|---|
Author | Dimitry Sibiryakov |
Post date | 2003-01-23T06:00:40Z |
On 22 Jan 2003 at 13:53, Michael.Straub@... wrote:
but encode and decode time by hands, because Delphi's format of date/time
is binary too. Direct conversion is faster.
changed in the foreseeable future. They are compact and wide enough.
SY, Dimitry Sibiryakov.
>fields. The IB documentation (Langref.pdf) states that ISC_TIME,Yes, Langref is wrong.
>ISC_DATE, and ISC_TIMESTAMP are all 64 bits. However ibase.h shows
>ISC_TIMESTAMP to be a structure containind ISC_TIME and ISC_DATE. From
>my testing I am showing the ISC_TIME and ISC_DATE to be 32 bits. Is
>the given size for ISC_TIME and ISC_DATE a typo?
>The ISC_TIME appears to be a value based on the number of tenths ofYes, it is.
>milliseconds from midnite. I adding a second to the struct tm and
>doing an isc_encode_timestamp() call bumped the ISC_TIME value by
>10,000 incrementing the minute added 600,000 to the value and
>incrementing the hour added 36,000,000 to the value. Is my
>interpretation of the format correct?
>I am trying to add milliseconds onto the timestamp value, but structIn my access components I don't use isc_(en/de)code_timestamp() at all
>tm only goes to seconds. Can I use the struct tm in the
>isc_encode_timestamp() and then add the (milliseconds * 10) to the
>ISC_TIME portion of the timestamp to load into the sqlvars? To reverse
>the procedure would I isc_decode_timestamp() and then do a (ISC_TIME %
>10000)/10 to get out the milliseconds?
but encode and decode time by hands, because Delphi's format of date/time
is binary too. Direct conversion is faster.
> This seems to work but I wantI don't think that internal formats of date and time will be
>to make sure my assumptions are valid and this will continue to be
>supported in future versions.
changed in the foreseeable future. They are compact and wide enough.
SY, Dimitry Sibiryakov.