[ome-devel] Timestamp over HQL
Douglas Russell
douglas_russell at hms.harvard.edu
Thu Jan 11 19:07:43 GMT 2018
Hi,
I noticed something weird when getting timestamps using HQL:
If I use the `omero hql` functionality I get this:
(virtualenv) [omero-local at itlomerop01 ~]$ omero_server hql "SELECT event.id,
event.time FROM Event event WHERE id=4621437"
# | Col1 | Col2
---+---------+--------------------------
0 | 4621437 | Mon Jan 23 14:12:45 2017
(1 row)
Looks correct, and also this is what I see when I use the webclient.
Also, if I query the database directly I get the same date and if I ask the
database to convert to seconds from epoch, I get what I expect to see:
select extract(epoch from event.time) from event where id = 4621437;
date_part
----------------
1485180765.782
However, if I do a projection HQL query the response I get is:
Event ID, Event Time
4621437 1428347867334
What is 1428347867334? It's not seconds/milliseconds/microseconds/etc from
epoch.
The same is true when trying to query over a given range using an HQL
projection, which is ultimately what I was trying to achieve (a projection
where I use several criteria including the event timestamp).
Cheers,
Douglas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20180111/d76e45a6/attachment.html>
More information about the ome-devel
mailing list