Subject [firebird-support] Re: Timestamp difference Windows / Linux
Author Svein Erling Tysvær
Hi Roy!

I know nothing about isc_decode_timestamp, and cannot comment whether that bit is bad Firebird behaviour or not. Though, logically, I'd say that time values are inexact, just like floating point numbers and that using equality when comparing them could lead to trouble. Hence, I'd recommend to rather use something like

WHERE DammanTimeStampField between '2008-08-18 15:04:59' - 0.0000116 and '2008-08-18 15:05:01'

when looking for values approximately equal to 2008-08-18 15:05:00.

HTH,
Set

-----Original Message-----
From: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] On Behalf Of roydamman
Sent: 18. august 2008 13:51
To: firebird-support@yahoogroups.com
Subject: [firebird-support] Re: Timestamp difference Windows / Linux

Hello,

>
> Do you need the high resolution for your application? If not, your
could
> always round or truncate the Linux timestamp before inserting it.
>

Thats the problem. The server assigns the value of the timestamp. This
way I have not to depend on the client date and time. On Linux the
precision of the timestamp is 1/10000 second, on Windows 1 second.
When reading the value of the (Linux FB) server the Linux high
precision gets lost on a Windows client by the FB client function
isc_decode_timestamp. I think this is bad behaviour.

> What are you trying to do? I mean, how do you want to use the
timestamps?
>

As initally written I use the timestamp for comparisment if a record
has changed between my start of editing and committing the changes
(for this I use a userid (integer) and a timestamp). Reading and
committing are done in seperate transactions. After committing I check
the rows affected. This value should be one.
I know I could/should use RDB$DB_KEY but this involves a rewrite of
the application.

Thanks,

Roy Damman