File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Specify Date as 0000-00-00 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Specify Date as 0000-00-00" Watch "Specify Date as 0000-00-00" New topic

Specify Date as 0000-00-00

Angela lewis
Ranch Hand

Joined: Mar 01, 2004
Posts: 100
I need to specify the date as 0000-00-00.
if i use
java.sql.Date end_on = new java.sql.Date(00000000L);
it gives me the value
I am using Oracle as database.
john smith
Ranch Hand

Joined: Mar 04, 2004
Posts: 75
Use the TO_DATE oracle function. java.sql.Date is seeded from Jan 1, 1970 00:00:00.000 GMT, so you'll not get a date earlier than this.
Adrian Yan
Ranch Hand

Joined: Oct 02, 2000
Posts: 688
Ummm... I don't think there is such date as 0000-00-00, calendar starts with January first (01-01). If you want to use it as a placeholder why not use null?
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

Note, though, that there was no year 0; years in A.D. start counting at 1. It'd be perfectly valid for any software to reject your attempts to represent this date.

[Jess in Action][AskingGoodQuestions]
Angela lewis
Ranch Hand

Joined: Mar 01, 2004
Posts: 100
Thank You so much for helping.
I agree. Here's the link:
subject: Specify Date as 0000-00-00
It's not a secret anymore!