-
1. Re: SQL query to get a human readable display of the *number* REVINFO.timestamp ?
adamw Jan 3, 2012 9:15 AM (in response to faridc)I'm sure there are some SQL functions to do that (matter of looking in your RDBMS docs)
Adam
-
2. Re: SQL query to get a human readable display of the *number* REVINFO.timestamp ?
rafaeluchoanaskar Mar 27, 2012 2:14 PM (in response to faridc)Using TO_DATE:
select
to_char(
TO_DATE('01/01/1970 00:00:00','DD/MM/YYYY HH24:MI:SS') + (r.revtstmp /1000/60/60/24),
'DD/MM/YYYY HH24:MI:SS'
) timestamp,
r.*, a.*
from table_aud a, revinfo r
where r.rev = a.rev
order by r.revtstmp desc
Or a more accurate way using TIMESTAMP:
select
to_char(
to_timestamp_tz('01-JAN-1970 00:00:00.000+00:00', 'DD-Mon-RR HH24:MI:SS.FFTZH:TZM') + (r.revtstmp /1000/60/60/24),
'DD/MM/YYYY HH24:MI:SS'
) timestamp,
r.*, a.*
from table_aud a, revinfo r
where r.rev = a.rev
order by r.revtstmp desc
You may need to convert the timezone.
-
3. Re: SQL query to get a human readable display of the *number* REVINFO.timestamp ?
faridc Mar 28, 2012 7:41 AM (in response to rafaeluchoanaskar)Thank you Rafael,
I tested the timestamp query, it works
-
4. Re: SQL query to get a human readable display of the *number* REVINFO.timestamp ?
eduard.drenth Sep 12, 2019 5:24 AM (in response to faridc)For postgres (11) you can use:
create view timewindow as
select id, username,
to_timestamp('01-01-1970 00:00:00', 'DD-MM-YYYY HH24:MI:SS') + timestamp * interval '1 millisecond'
as timestamp
from revisioninfo;
Querying this for example like below will work:
select * from timewindow where timestamp > '2019-08-19';