Home » SQL & PL/SQL » SQL & PL/SQL » unix time to date (Oracle 11g, Solaris)
unix time to date [message #601688] Sun, 24 November 2013 08:52 Go to next message
apenkov
Messages: 15
Registered: October 2012
Junior Member
Hello,
I have records in a database with unix date and time and I am using the following select to fetch data based on dates.
NVL(valid_from - to_date('19700101000000', 'YYYYMMDDHH24MISS'), 0)*3600*24,
NVL(valid_to, sysdate+10000 ) - to_date('19700101000000', 'YYYYMMDDHH24MISS'))*3600*24

My question is, how can I add to this GMT time. Let's say I want records with GMT +1.

Thanks!
BR,
Atanas
Re: unix time to date [message #601689 is a reply to message #601688] Sun, 24 November 2013 09:08 Go to previous messageGo to next message
BlackSwan
Messages: 21941
Registered: January 2009
Senior Member
1 minute = 60 second
1 hour = 60 minutes
therefore 1 hour = 3600 seconds; so adjust by 3600
Re: unix time to date [message #601781 is a reply to message #601688] Mon, 25 November 2013 11:15 Go to previous message
apenkov
Messages: 15
Registered: October 2012
Junior Member
Thank you Black Swan, I didn't think about that option Smile
Previous Topic: constraints
Next Topic: ORA-01001: invalid cursor
Goto Forum:
  


Current Time: Fri Apr 18 00:07:18 CDT 2014

Total time taken to generate the page: 0.05149 seconds