简体   繁体   中英

How to convert java time to date in oracle table?

I have table with column write_date type NUMBER. I found that in that column saved Date.getTime(); Does exist Oracle function that can return me date like DDMMYYYY ? Thanks

是。

cast(to_date('01-jan-1970','dd-mon-yyyy') + your_long/86400000 as timestamp ) ts

Cast your number as a date using to_date with the 'ddmmyyyy' format. Further information can be found at the link, which is to the Oracle documentation.

to_char(to_date(1970,'yyyy') + java_time/86400000, 'ddmmyyyy')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM