mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 06:32:19 +03:00
fix NTP 2902 и мелкие правки
This commit is contained in:
@@ -167,6 +167,15 @@ unsigned long strDateToUnix(String date) {
|
||||
int numberOfLeepYears = 12;
|
||||
int totalNormalYears = year - 1970 - numberOfLeepYears;
|
||||
unsigned int daysInMonth[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
|
||||
if (year % 4 == 0) {
|
||||
if (year % 100 != 0 || year % 400 == 0) {
|
||||
daysInMonth[1] = 29;
|
||||
} else {
|
||||
daysInMonth[1] = 28;
|
||||
}
|
||||
} else {
|
||||
daysInMonth[1] = 28;
|
||||
}
|
||||
int numberOfDaysInPastMonths = 0;
|
||||
for (int i = 0; i <= 11; i++) {
|
||||
if (i <= month - 2) {
|
||||
|
||||
Reference in New Issue
Block a user