Subject Re: [firebird-php] timestamp milliseconds
Author Lester Caine
On 05/10/17 19:05, 'Daniel Miller' dmiller@... [firebird-php] wrote:
> well...something like:
> using arcane incantations of ibase_query...perform something similar to
> "select SOMETIME from SOMETABLE rows 1;" and store in $phpvar.
> So $phpvar now has a timestamp - but lacking the milliseconds.
> Now, go looking for that:
> "select VALUE, ABLE, INFO from SOMEOTHERTABLE where SOMETIME = $phpvar"
> This will return a null set. So my functional but highly offensive
> workaround is:
> (SOMETIME - cast($phpvar as timestamp)) > 0
> and (SOMETIME - cast($phpvar as timestamp)) < .001
> and datediff(second from (SOMETIME - cast($phpvar as timestamp)) = 0"
> There has got to be a better way to do this.

What value are you putting in 'SOMETIME'?
flags just which presets return milliseconds and which do not, but part
of the problem with your example is that '$phpvar' is not the best value
to use as a key into other data. A generator value will prevent problems
with time stamps that clash ... which is something I have been hit by in
the past ;)

If you must use the raw timestamp as a key, then I'm still a little
confused since while I'm using second accurate data, it still displays
the '.000' in every timestamp string. What are you using to access
Firebird php_interbase or pdo_firebird? I only use the Interbase driver
not the PDO one, so I'm not sure if the PDO::FB_ATTR_TIMESTAMP_FORMAT
trims the milliseconds on the PDO one ...

Lester Caine - G8HFL
Contact -
L.S.Caine Electronic Services -
EnquirySolve -
Model Engineers Digital Workshop -
Rainbow Digital Media -