Hello to everybody.

I'm designing a software application that, among other things, does  
cataloguing of some objects. Time tagging is part of this cataloguing  
stuff. Time formats supported by the system include:

+ day/month/year for recent dates (e.g. May 5, 1821) - maybe some  
also require time.
+ d/m/y with ranges due to uncertainty of available data (e.g. Feb  
10, 1720 - Feb 15, 1720)
+ only year on only century due to uncertainty of data (e.g. XII  
century AD, IV century B.C., 50,000 B.C.)
+ dates could be also formatted with 'strange' calendars, such as  
Maya etc...
+ there should be an unique, sortable representation for all dates

Up to now, a prototype that focused on other aspects has been  
developed, and for what concern dates I've been using a simple  
integer to count days with respect to a certain reference and another  
int to model precision. A few hours work that was good for the  
prototype, but now I'm working for a second release for which I want  
to adopt a more stable, and possibly based on third-party libraries,  
solution. Joda time is for the the perfect candidate for a number of  
reasons, it appears to have all I need and to be easily extendable  
for other needs, and I appreciate a lot the fact that it has become a  
basis for the upcoming JSR-310 - but for some aspects that I'd like  
to clarify.

At present, my specs for the date range are relative to "historic"  
date ranges, so the +/- 290 million years is quite good for me. But  
the customer would like to extend the system also for dates that  
reach to paleontologic ages, which include tens and hundreds of  
millions of years ago. Now I've read the FAQ:
 > What date range is supported?

 > The range supported is -292,269,054 to 292,277,023. In other  
words, roughly +/- 290 million years to millisecond precision.

 > If you want a date outside this range, ask yourself if you really  
want millisecond precision. In reality, dates this far in the past or  
future should only be stored as years - anything else is meaningless.



and sure I don't need anything close to millisecond etc. precision  
for such an ancient date. Nevertheless I didn't understand whether  
Joda time is able to represent such a date as 1.500.000.000 B.C, even  
with a (much) lower precision. Remember that I want to keep a single  
representation (i.e. a single number) for every date, and I don't  
want to switch to variant schemas for dates before/after a certain  
threshold.



Second question: I need to put those dates into a database. I've read  
about the Hibernate contrib, but I'm worried about being 0.8 and last  
updated more than one year ago. Furthermore, I'm using Hibernate, but  
hidden behind the Java Persistence API; and I could have some  
constraints (that at the moment I can't relax) about storing those  
dates as plain numbers or even strings (i.e. a number stringified),  
for instance when exporting XML files. I presume that converting a  
Joda date to/from an integer is not an issue.



The project I'm working on should be opensourced, so it's likely that  
any extension that might be needed could be contributed back to Joda  
time.



Thank you in advance.




-- 
Fabrizio Giudici, Ph.D. - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/blog
[EMAIL PROTECTED] - mobile: +39 348.150.6941



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Joda-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/joda-interest

Reply via email to