Fixed broken clock, and added binary
							parent
							
								
									ebdcef55db
								
							
						
					
					
						commit
						feed0ab7e7
					
				
										
											Binary file not shown.
										
									
								
							|  | @ -97,15 +97,20 @@ int main() { | ||||||
|                 refresh(); |                 refresh(); | ||||||
|                 break; // Exit the countdown loop
 |                 break; // Exit the countdown loop
 | ||||||
|             } else { |             } 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; |  | ||||||
| 
 | 
 | ||||||
|                 // Print the countdown
 | 		// 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); | ||||||
|  | 
 | ||||||
|  | 		// 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", |                 printw("Time remaining: %d years, %d months, %d days\n%d hours, %d minutes, %d seconds", | ||||||
|                        years, months % 12, days % 7, hours, minutes, seconds); |                        years, months % 12, days % 7, hours, minutes, seconds); | ||||||
|             } |             } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue