I know this should be simple, but I can't find anything on the internet.
Given some conditions, I want to get the next Date
when they will be met. For example, if conditions are minute = 01
and second = 30
and now the time is 15:58:00
, the function should return today at 16:01:30
. How can I accomplish this in Java?
I need to be able to set conditions of, at least, seconds, minutes and hours, but I would like to have the possibility to set one condition to any value (like the example above, that doesn't specify an hour).
Thanks and sorry for my bad English.
EDIT: I see there's something that might need clarification: I want to get a Date (or whatever) always after the current time that meets conditions. Also, this is for a Minecraft Spigot server, maybe this information can help.