Closed timozattol closed 10 years ago
Can't really help you here. Pity, joda time is quite simple and works very well.
How do you want to create/use the dates ?
For our semester project last year in Java, we created a new Date class, you can take a look at what we've done if you want. After, it really depends on how do you want to use them.
Well it's in the Transaction Model, so we'll probably want to print them, and use them to sort the Transactions...
If it's only for sorting the transactions, longs in the YYYYMMDDhhmmss format can be sorted by size so that they appear in temporary order But having a Date model will make the code better : )
Okay, thanks! With your advice, I imported Joda-Time in the libs, it works well. I also think it's a lot better to have an actual Date (DateTime) class.
AArg I've been reading a few forums now no-one seems to agree, how to store dates and time in Java ? The "Date" class has almost all of its methods deprecated, "Calendar" seems to be a lot of overhead for nothing (and lots of forums said that we shouldn't use it either), who knows a simple way to store a dateandtime ?
Thanks
http://stackoverflow.com/questions/1404210/java-date-vs-calendar/1404216#1404216 http://stackoverflow.com/questions/344380/why-is-january-month-0-in-java-calendar/344400#344400 etc.
PS: I don't want to use "joda time" since it's not part of the standard java API