Subject | [firebird-support] Re: Timestamp difference Windows / Linux |
---|---|
Author | Svein Erling Tysvær |
Post date | 2008-08-18T13:07:23Z |
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,
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.
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
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,
>could
> Do you need the high resolution for your application? If not, your
> 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 thetimestamps?
>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