Home » SQL & PL/SQL » SQL & PL/SQL » Howto convert unix timestamp to date
Howto convert unix timestamp to date [message #7273] Mon, 02 June 2003 00:40 Go to next message
wookie
Messages: 1
Registered: June 2003
Junior Member
I have a unix timestamp (ie. 1054532238) saved in a column. How do I convert these into human readable dates with 9i in a (simple) SELECT query ?

Thanks y'all...
Re: Howto convert unix timestamp to date [message #7285 is a reply to message #7273] Mon, 02 June 2003 10:22 Go to previous message
Art Metzer
Messages: 2480
Registered: December 2002
Senior Member
quote from wookie:
----------------------------------------------------------------------
I have a unix timestamp (ie. 1054532238) saved in a column. How do I convert these into human readable dates with 9i in a (simple) SELECT query ?

Thanks y'all...

----------------------------------------------------------------------
SQL> SELECT TO_CHAR(TO_DATE('197001','YYYYMM')
  2                 + 
  3                 (<font color=red>1054532238</font> / 60 / 60 / 24)
  4         ,       'fmDy MM/DD/YYYY HH12:fmMI:SS AM') unix_time
  5  FROM   DUAL
  6  
SQL> /
  
UNIX_TIME
-----------------------
Mon 6/2/2003 5:37:18 AM
  
SQL> 
HTH,

A
Previous Topic: Find thrid lowest value from the table
Next Topic: How to check if a table exists and then drop it?
Goto Forum:
  


Current Time: Thu Apr 25 14:53:25 CDT 2024