[英]Datetime format in xml from Oracle
I have a simple requirement to display a time field as a Datetime in xml when converted from excel.我有一个简单的要求,即在从 excel 转换时将时间字段显示为 xml 中的日期时间。 Being new to Oracle field, I'm stuck with a few questions
作为 Oracle 领域的新手,我被几个问题困住了
When I run the below query in Oracle my value is displayed as 31-DEC-99 07.45.30.000000000当我在 Oracle 中运行以下查询时,我的值显示为 31-DEC-99 07.45.30.000000000
select to_timestamp('1899-12-31 07:45:30', 'yyyy-mm-dd hh:mi:ss') as res from dual;
Now,I understand that my NLS_DATE_FORMAT = 'DD-MON-RR' and hence the date is shown as 31-DEC-99 but why is the time shown as hh.mm.ss.ffff rather than hh:mm:ss:ffff现在,我知道我的 NLS_DATE_FORMAT = 'DD-MON-RR' 因此日期显示为 31-DEC-99 但为什么时间显示为 hh.mm.ss.ffff 而不是 hh:mm:ss:ffff
Just to confirm, my requirement here is to get a timestamp displayed in excel properly when downloaded from oracle table and display the same as a datetime field when I open in xml只是为了确认,我的要求是在从 oracle 表下载时在 excel 中正确显示时间戳,并在我在 xml 中打开时显示与日期时间字段相同的时间戳
Is this concerning a BI/XML Publisher report?这是否与 BI/XML Publisher 报告有关? If so, you need to do something like this to your dates in your data definition:
如果是这样,您需要对数据定义中的日期执行以下操作:
TO_CHAR(ORDERED_DATE,'MM-DD-YYYY HH24:MI:SS') ORDERED_DATE
Realised it was the NLS_DATETIME_FORMAT that I had to worry about.意识到这是我不得不担心的 NLS_DATETIME_FORMAT。 Changed that for my session and worked like a charm.
为我的会话更改了它,并且像魅力一样工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.