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 to_date('19700101','yyyymmdd') + (first_date/24/60/60)
thedate
  2  from unix_time;

THEDATE
---------
02-AUG-37
16-AUG-04
22-JUL-89
16-JUN-59
16-JUN-59
29-JAN-08
03-SEP-04
05-AUG-70
03-SEP-04

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