aspose file tools*
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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Specify Date as 0000-00-00" Watch "Specify Date as 0000-00-00" New topic
Author

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
1970-01-01
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
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

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: http://aspose.com/file-tools
 
subject: Specify Date as 0000-00-00