[英]Oracle server date format
I've got a report made with Eclipse which builds a table with Strings
and Dates
through a SQL query, and running it locally it works fine, but when I bring it on my oracle server the day and month are switched, not visually, but just the data, let me do an example: 我有一份使用Eclipse制作的报告,该报告通过SQL查询用
Strings
和Dates
构建了一个表,并在本地运行它可以正常工作,但是当我将其带入oracle服务器时,日期和月份就切换了,不是视觉上的,而是只是数据,让我做一个例子:
Dates generated locally on Eclipse (dd/mm/yy): 在Eclipse上本地生成的日期(dd / mm / yy):
01/06/17 (1st jun)
31/12/17 (31st dec)
Same dates on report generated on server (dd/mm/yy): 服务器上生成报告的日期相同(dd / mm / yy):
06/01/17 (6th jan)
12/31/17 <- which shows the row retrieved by the query but leaves a blank space in the "my_date" column
Does anybody have an idea on why this happens? 有谁知道为什么会这样吗? Thanks.
谢谢。
EDIT: these are my SESSION parameters, I can't change them right now but I'll keep you updated if that works out. 编辑:这些是我的SESSION参数,我现在不能更改它们,但是如果可以的话,我会及时通知您。 Thanks!
谢谢!
Try changing the NLS_DATE_FORMAT
. 尝试更改
NLS_DATE_FORMAT
。 For example: 例如:
ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH:MI:SS'
or: 要么:
ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY MM DD';
or whatever other format you like. 或您喜欢的其他任何格式。 Check the fine manual
查看精美手册
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.