简体   繁体   English

如何在Oracle表中将Java时间转换为日期?

[英]How to convert java time to date in oracle table?

I have table with column write_date type NUMBER. 我的表的列write_date类型为NUMBER。 I found that in that column saved Date.getTime(); 我发现在该列中保存了Date.getTime();。 Does exist Oracle function that can return me date like DDMMYYYY ? 是否存在可以返回我日期的Oracle函数(如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. 使用to_date以'ddmmyyyy'格式将您的数字转换为日期。 Further information can be found at the link, which is to the Oracle documentation. 有关更多信息,请参见Oracle文档的链接。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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