thanks & regards,
Shiva rama krishan,
Mohamed Sanaulla | My Blog | Author of Java 9 Cookbook | Java 11 Cookbook
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
thanks & regards,
Shiva rama krishan,
Rajani Gummadi wrote:Hi Rob,
There is one question troubling me a bit on the approach you suggested, though my test against that logic proved satisfactory. We are adding a day from the starting day and comparing that with the current, this is pretty straightforward and looking great to me. Thanks for that. But I'm just thinking, if my program has to run for say 100 years from now, and it needs to calculate every day, that is time complexity is increasing as we move on. I did a sample test with the start day as Mar 01, 2011 and changed my system date to 01/01/2099 and ran the code... well I did not notice any significant increase in completing the loop. but would that have any impact in production, where other facts and load is considered.
Also, how much can we loose, if we follow calculating millis and dividing by 24 * 60 * 60 *1000.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Spoor wrote:There is another way to solve this
Rob Spoor wrote:
Also, how much can we loose, if we follow calculating millis and dividing by 24 * 60 * 60 *1000.
At most one day, if the rounding is not right and you use midnight as measuring point. If the first day is the day where you get one hour extra, adding 24 will not be midnight the next day but 11 PM on the same day.
Don't play dumb with me! But you can try this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|