Marc, himself, his blogs, and you reading them.
.. isn't quite near, according to Java.
So I was looking for a useful constant that could be used as an end-Period marker that would mean 'not bound' (in other words: a period that lasts untill the end of time). In pure Java I would generally use null for this but I was assured that when jotting these in databases one would generally try to avoid the extra where-clause fuzz of needing to check for IS NULL and the like. Come to think of it, there is some extra testing in Java to avoid NPEs as well.
In cases like this I'm always looking for some absolute, universal (no discussion possible) value for such constant to avoid the pragmatic decision to just agree on some (arbitrary!, good heavens!) date like March 3rd, 3003. (Agreement is easily found as long as the date exceeds the life expectations of every member of the development team :-)) Yeah, vague memories of Y2K.
So what to think of this:
Date endOfTime = new java.util.Date(Long.MAX_VALUE);
FYI: Sun Aug 17 07:12:55 CET 292278994 -- 807 millis This is pretty much the time Java will surely die I guess, and if it's surviving untill then it will surely have been a huge success :-)
At the least it's quite an enteristing border case to test the validity of your date manipulation algorithms.
Anyways, sql databases seem to be generally cutting-off at 31-12-9999 23:59:59. so being driven from the database angle anyway I'm kinda setteling for less ambitious live spans of the software we're building :-)
# Posted by mpo at 09:49 AM | TrackBack
