This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Zero date Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Zero date" Watch "Zero date" New topic
Author

Zero date

Alex Armenteros
Ranch Hand

Joined: May 05, 2010
Posts: 69
My partner for some reason (and he won't change his mind) needs for another program (C++ w/o hibernate) a datetime column with the value "0000-00-00 00:00:00" . is there some way to insert/update that value FROM hibernate?
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3606
    
  60

I'm afraid he'll have to initiate a calendar reform to achieve that

There are three problems with that date: no day zero exists, no month zero exists, and actually, no year zero exists in the Julian/Gregorian calendar, though the last one is probably not enforced by at least some datetime libraries.

So, that date can be represented neither in the database, nor in a datetime representation in any reasonable language. My opinion is that it is therefore impossible. The only possibility I see is to choose a special value (such as NULL) and represent that value in the user interface as "0000-00-00 00:00:00". Though displaying a "null" or empty field instead would be probably even better.
Alex Armenteros
Ranch Hand

Joined: May 05, 2010
Posts: 69
I already know that but the bad thing is that he is pretty stubborn and won't change his program, We'll try another aproach... Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Zero date
 
Similar Threads
jsp table
java.sql.Date '0000-00-00' problem
24 Hour Format In HQL - 00:00:00 returned as 24:00:00 using HQL
Oracle Date and Time problem
How to identify Auth method NTLMv1 or NTLMv2