Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java - cycle through time for a day

Tags:

java

I need to iterate throught the time for one day. I have the starting time: 00:00 and the end time: 23:59. I want to cycle through every minute of an hour.

How can I achieve this in Java? Does any Java library for this exist?

like image 216
JJunior Avatar asked Jun 03 '26 04:06

JJunior


1 Answers

for (int hour = 0; hour <= 23; hour++) {
    for (int minute = 0; minute <= 59; minute++) {
        // ...
    }
}
like image 80
Vivien Barousse Avatar answered Jun 05 '26 16:06

Vivien Barousse



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!