Joanne
OCMJEA - In progress - studying, OCPJP 7 - 90%, OCAJP 7 - 93%
http://silviuburcea.blogspot.ro/
Karthick D V
Laura Miclescu wrote:Thanks, guy! I ended up using GregorianCalendar to set a customized date, since subtracting days is not pretty accurate in my case, for calculating a billing period.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:
Laura Miclescu wrote:Thanks, guy! I ended up using GregorianCalendar to set a customized date, since subtracting days is not pretty accurate in my case, for calculating a billing period.
I have to admit still being slightly mystified by your requirements. If they are indeed, as you said in your OP, "always 30 days", then you can subtract (or add) 30 days from any java.util.Date.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Spoor wrote:Except that the length of a day is not always 24*3600*1000 ms. Daylight savings time gives you one day per year that's 1 hour longer and one that's 1 hour shorter. That's what makes day-arithmetic tricky when not done using Calendar or java.time.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:You could also get around it by either:
[...]
Stephan van Hulst wrote:Or by simply using Joda or java.time :P
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:And then you can use a simple algorithm as opposed to a complicated one.
Stephan van Hulst wrote:
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here