Calendar calendar = Calendar.getInstance();
this does not update after the program has been launched.
Its an assignment statement that puts the current value of something in a variable.
If you want a new/current value assign it again now. i want it to be able to count the number of hours it has been open
Save the time when it was open. Get the current time. Divide by the number of units of time in an hour.
You can use the System.currentTimeMillis() method to get the time.
NormR1
Posting Expert
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656