Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Convert Date to Number
"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