Fixed broken clock, and added binary
							parent
							
								
									ebdcef55db
								
							
						
					
					
						commit
						feed0ab7e7
					
				
										
											Binary file not shown.
										
									
								
							|  | @ -97,13 +97,18 @@ int main() { | |||
|                 refresh(); | ||||
|                 break; // Exit the countdown loop
 | ||||
|             } else { | ||||
| 
 | ||||
| 		// Calculate seconds, minutes, hours, days, months, and years
 | ||||
| 		int seconds = timeDifference % 60; | ||||
| 		int minutes = (timeDifference / 60) % 60; | ||||
| 		int hours = (timeDifference / (60 * 60)) % 24; | ||||
| 		int days = timeDifference / (24 * 60 * 60); | ||||
|                 int months = (retireDate.tm_year - (currentTime / (365.25 * 24 * 60 * 60))) * 12 + retireDate.tm_mon - (currentTime / (30.44 * 24 * 60 * 60)); | ||||
|                 int years = months / 12; | ||||
| 
 | ||||
| 		// Calculate the number of years, months, and days
 | ||||
| 		int years = days / 365; | ||||
| 		int remainingDays = days % 365; | ||||
| 		int months = remainingDays / 30;  // Approximate number of days in a month
 | ||||
| 		remainingDays %= 30;             // Remaining days after subtracting months
 | ||||
| 
 | ||||
| 		// Print the countdown
 | ||||
|                 printw("Time remaining: %d years, %d months, %d days\n%d hours, %d minutes, %d seconds", | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue