I'm trying to get the current time using
Date date = new Date().getHours();
But I see it's been depracated in SE 7. Also I'm trying to create a Date object and then just setting the hours on it using
Date date = new Date().setHours();
And that's been deprecated as well. Let me lay out what I want to do: I want to run a process when it's between midnight and 5am in the morning. The way I'll do this (or wanted to do anyways), was create two variables. One indicating the start time (being midnight) and the other the stop time (5 am).
I would then loop the program the whole time every 5 mins, getting the current time and comparing it to the start time and stop time to see if it falls between those two times. And then start the processes that I want to run.
So with all this method deprication (Wish I knew the reasoning behind it), what's currently the best way to do that in SE 7?
PS - Since I'm only concerned with the time, is it even necessary to use the Date class and not something else?