Subject | Re[2]: [firebird-php] timestamp milliseconds |
---|---|
Author | Daniel Miller |
Post date | 2017-10-05T18:05:28Z |
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:
"select VALUE, ABLE, INFO from SOMEOTHERTABLE where
(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.
--
Daniel
On 10/5/2017 1:58:20 AM, "Lester Caine lester@...
[firebird-php]" <firebird-php@yahoogroups.com> wrote:
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:
"select VALUE, ABLE, INFO from SOMEOTHERTABLE where
(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.
--
Daniel
On 10/5/2017 1:58:20 AM, "Lester Caine lester@...
[firebird-php]" <firebird-php@yahoogroups.com> wrote:
>On 05/10/17 09:36, 'Daniel Miller' dmiller@... [firebird-php]
>wrote:
>>It seems when querying a table with a timestamp column, the retrieved
>>value does not contain the milliseconds - even though they are stored
>>and visible in Flamerobin. How can I include the subseconds in the
>>retrieval?
>
>I think we need a bit more data on what you are actually using in php
>to
>work out just where the problem is. I have to trim the microseconds
>when
>displaying my timestamps ...
>
>--
>Lester Caine - G8HFL
>-----------------------------
>Contact - http://lsces.co.uk/wiki/?page=contact
>L.S.Caine Electronic Services - http://lsces.co.uk
>EnquirySolve - http://enquirysolve.com/
>Model Engineers Digital Workshop - http://medw.co.uk
>Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
>
>
>------------------------------------
>Posted by: Lester Caine <lester@...>
>------------------------------------
>
>
>------------------------------------
>
>Yahoo Groups Links
>
>
>