On Jun 8, 4:21 am, Iyad Bacdounes <[email protected]> wrote:
> Hello,
>
> I have table with column FIRST_DATE contain date data
> but the data type of this column is NUMBER(19)
>
> is it possible to convert it to date ??
>
>  *FIRST_DATE*  1256079902759  1261351075138  1264031290994  1263081389427
> 1263081386807  1233058735800  1261352573131  1250810075236  1261352632195
>
> --
> Best Regards,
>
> Iyad

SQL> create table unix_time(first_date number);

Table created.

SQL>
SQL> insert all
  2  into unix_time
  3  values(1256079902759)
  4  into unix_time
  5  values(1261351075138)
  6  into unix_time
  7  values(1264031290994)
  8  into unix_time
  9  values(1263081389427)
 10  into unix_time
 11  values(1263081386807)
 12  into unix_time
 13  values(1233058735800)
 14  into unix_time
 15  values(1261352573131)
 16  into unix_time
 17  values(1250810075236)
 18  into unix_time
 19  values(1261352632195)
 20  select * from dual;

9 rows created.

SQL>
SQL> select (timestamp '1970-01-01 00:00:00 CST' +
  2     numtodsinterval(first_date/1000, 'SECOND'))
  3     at time zone 'US/Central'
  4  from unix_time
  5  /

(TIMESTAMP'1970-01-0100:00:00CST'+NUMTODSINTERVAL(FIRST_DATE/
1000,'SECOND')
---------------------------------------------------------------------------
21-OCT-09 12.05.02.759000000 AM US/CENTRAL
20-DEC-09 11.17.55.138000000 PM US/CENTRAL
20-JAN-10 11.48.10.994000000 PM US/CENTRAL
09-JAN-10 11.56.29.427000000 PM US/CENTRAL
09-JAN-10 11.56.26.807000000 PM US/CENTRAL
27-JAN-09 12.18.55.800000000 PM US/CENTRAL
20-DEC-09 11.42.53.131000000 PM US/CENTRAL
21-AUG-09 12.14.35.236000000 AM US/CENTRAL
20-DEC-09 11.43.52.195000000 PM US/CENTRAL

9 rows selected.

SQL>

David Fitzjarrell

-- 
You received this message because you are subscribed to the Google
Groups "Oracle PL/SQL" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Oracle-PLSQL?hl=en

Reply via email to