Fixed broken clock, and added binary

main
splitshockvirus 2023-10-07 14:05:31 -04:00
parent ebdcef55db
commit feed0ab7e7
2 changed files with 13 additions and 8 deletions

BIN
nctime_money Executable file

Binary file not shown.

View File

@ -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",