Commit 96278d4e authored by Walterio Montanez's avatar Walterio Montanez

autosave

parent 4d66494b
......@@ -174,33 +174,48 @@ double dateToHour (string month, int day, int hour, int minute) { // Converts th
double totHours = 0;
int monthNum = 0;
if(month == "January") {
monthNum = 1;
if (month == "January") {
monthNum = 0;
} else if (month == "February") {
monthNum = 2;
monthNum = 1;
} else if (month == "March") {
monthNum = 3;
monthNum = 2;
} else if (month == "April") {
monthNum = 4;
monthNum = 3;
} else if (month == "May") {
monthNum = 5;
monthNum = 4;
} else if (month == "June") {
monthNum = 6;
monthNum = 5;
} else if (month == "July") {
monthNum = 7;
monthNum = 6;
} else if (month == "August") {
monthNum = 8;
monthNum = 7;
} else if (month == "September") {
monthNum = 9;
monthNum = 8;
} else if (month == "October") {
monthNum = 10;
monthNum = 9;
} else if (month == "November") {
monthNum = 11;
monthNum = 10;
} else {
monthNum = 12;
monthNum = 11;
}
totHours += (monthNum * 730) + (day * 24) + (minute / 60);
if (month == "January" || month == "March" || month == "May" || month == "July" || month == "August" || month == "October" || month == "December") {
totHours = (monthNum * 744) + ((day - 1) * 24) + (hour - 1) + (minute / 60);
}
else if (month == "April" || month == "June" || month == "September" || month == "November") {
totHours = (monthNum * 720) + ((day - 1) * 24) + (hour - 1) + (minute / 60);
}
else if (month == "February") {
if (isLeap(year)) {
totHours = (monthNum * 696) + ((day - 1) * 24) + (hour - 1) + (minute / 60);
}
} else if (!isLeap(year)) {
totHours = (monthNum * 672) + ((day - 1) * 24) + (hour - 1) + (minute / 60);
}
}
}
return totHours;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment