• Post Reply Bookmark Topic Watch Topic
  • New Topic

Zero date  RSS feed

 
Alex Armenteros
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!