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

Home -> Community -> Usenet -> c.d.o.server -> Re: Convert Date to Number

Re: Convert Date to Number

From: Paul Dixon <paul.gp.dixon_at_bttinnedham.com>
Date: Fri, 11 Apr 2003 09:15:19 +0100
Message-ID: <b75u0c$8nl$1@pheidippides.axion.bt.co.uk>

"David COSTE" <dco_at_compaq.com> wrote in message news:_6hla.622$NH4.104_at_news.cpqcorp.net...
> Hello all,
>
> Does someone know if there is a simple way to convert dates in number with
> Oracle 9.2.0.
> For example, how to convert a date in a number of seconds elapsed since
> 1/1/1970 at 0:00:00 ?

David

(your_date_value - to_date('01-jan-1970','dd-mon-yyyy'))*86400 should get you pretty close. It does assume that there are 86,400 seconds in every day, which isn't actually true (e.g. GMT to BST and back clock changes).

Paul Dixon Received on Fri Apr 11 2003 - 03:15:19 CDT

Original text of this message

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