Sleep Timer2

Fixed My Previous problem... But, i've come across another one. Here's my code so far...

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  
  lcd.begin(16, 2);
  
  lcd.print("You Slept For:");
}

void loop() {
  
  lcd.setCursor(0, 1);
  lcd.print(millis()/3600000);
  lcd.setCursor(3,1);
  lcd.print("hrs, ");
  lcd.setCursor(8, 1);
  lcd.print(millis()/60000);
  lcd.setCursor(11, 1);
  lcd.print("mins");
}

Slight Problem, though.. It's showing the same amounts of minutes as it is for the hours (e.g. if you slept for 8 hours, it would show: 8 hrs, 480 mins) Anyway to overcome this? i.e. resetting it? Thanks in advance...

Please Reply!

My first thought is to make a variable and store the time in there one time, and then decrememt the number of hole hours from that before displaying minutes.

Something like:

unsigned long time = millis();
unsigned long hours = time/3600000;
unsigned long minutes = (time - (hours * 360000) ) / 60000;

Better readability to lose the big numbers (easy to miscount the zeros) and be a bit more general purpose:

unsigned long seconds = millis() / 1000 ;
unsigned long minutes = seconds / 60 ;
seconds -= minutes * 60 ; 
unsigned int hours = minutes / 60 ;
minutes -= hours * 60 ;

Etc etc for days/weeks!

does this reset the minute counter?