Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: convert date to unixtime

Re: convert date to unixtime

From: Andy Hassall <andy_at_andyh.co.uk>
Date: Thu, 02 Sep 2004 22:21:47 +0100
Message-ID: <6m3fj0psvu92h7icogk14dhdpoi3f1imu8@4ax.com>


On Thu, 02 Sep 2004 23:06:16 +0200, Peter Valicek <Sonny2_at_gmx.de> wrote:

>it is possible and how to get intead of the date field an Unixtimestamp
>back?
>I know in MySQL exist an function UNIX_TIMESTAMP(fieldname) which can do
>this. http://dev.mysql.com/doc/mysql/en/Date_and_time_functions.html
>
>How can I do this Oracle 8i?
>I haven't found which fits my needs.

 Subtracting dates from each other gives you the difference in days. So:

select (sysdate - to_date('19700101','YYYYMMDD')) * 86400 from dual

-- 
Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Received on Thu Sep 02 2004 - 16:21:47 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US