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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: seconds from midnight into a date field?

Re: seconds from midnight into a date field?

From: Carel-Jan Engel <cjpengel.dbalert_at_xs4all.nl>
Date: Mon, 12 Jul 2004 15:15:09 +0200 (CEST)
Message-ID: <24584.145.61.28.21.1089638109.squirrel@webmail.xs4all.nl>


A day has 86400 seconds. I presume your seconds-column ranges from 0 to 86400. Date expressions support fractions.

Your conversion function should be something like:

TO_DATE(TRUNC(SYSDATE /* or the day you want it to be */) + TO_NUMBER(your_column_with_seconds) / 86400)

Regards, Carel-Jan

===
If you think education is expensive, try ignorance. (Derek Bok) ===

> I have a varchar field that I need to migrate to a date field. it is in
> the form 'seconds from midnight' and looks like this
> 0001
> 0050
> 1054
> I can't find a to_date function to translate that. do any exist?
>
> ----------------------------------------------------------------
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> ----------------------------------------------------------------
> To unsubscribe send email to: oracle-l-request_at_freelists.org
> put 'unsubscribe' in the subject line.
> --
> Archives are at http://www.freelists.org/archives/oracle-l/
> FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
> -----------------------------------------------------------------
>



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Mon Jul 12 2004 - 08:13:00 CDT

Original text of this message

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