使用oracle10g的Java日期问题
我正在尝试从我在 VB.net 中重新制作的剩余程序中解码这段 java 代码(使用 oracle10g 数据库)。假设我在日期选择器上选择了 01/02/11:
AND (due_date between (to_date('" + dateChooserCombo1.getSelectedPeriodSet().toString()
+ "', 'MM/DD/YY') - 1)
AND (to_date('" + dateChooserCombo1.getSelectedPeriodSet().toString() + "', 'MM/DD/YY') + 1)
OR " + "begin_date between (to_date('" + dateChooserCombo1.getSelectedPeriodSet().toString() + "', 'MM/DD/YY') - 1)
AND (to_date('" + dateChooserCombo1.getSelectedPeriodSet().toString() + "', 'MM/DD/YY') + 1))
+1 在哪里,是添加月份 (02/02/11) 还是日期 (01/03/11)?对于-1,是减去一个月(12/02/10)还是一天(01/01/2011)?
大卫
I am trying to decode this little peice of java code (using an oracle10g database) from a left over program i am remaking in VB.net. Say i chose on the datepicker 01/02/11:
AND (due_date between (to_date('" + dateChooserCombo1.getSelectedPeriodSet().toString()
+ "', 'MM/DD/YY') - 1)
AND (to_date('" + dateChooserCombo1.getSelectedPeriodSet().toString() + "', 'MM/DD/YY') + 1)
OR " + "begin_date between (to_date('" + dateChooserCombo1.getSelectedPeriodSet().toString() + "', 'MM/DD/YY') - 1)
AND (to_date('" + dateChooserCombo1.getSelectedPeriodSet().toString() + "', 'MM/DD/YY') + 1))
Where the +1's are, is it adding a month (02/02/11) or day (01/03/11)? And for the -1's, is it subtracting a month (12/02/10) or a day (01/01/11)?
David
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是减去/增加一天。
尝试运行:
它应该返回:
It's subtracting/adding a day.
Try running:
it should return: