ptime.day=(png_byte) day;
ptime.hour=(png_byte) hour+addhours;
ptime.minute=(png_byte) minute+addminutes;
+ ptime.second=(png_byte) second;
if (ptime.minute > 60)
{
ptime.hour++;
- if (ptime.hour > 24)
- {
- ptime.hour = 0;
- ptime.day ++;
- /* To do: fix this for leap years */
- if (ptime.day > 31 || (ptime.month == 2 && ptime.day > 28) ||
- ((ptime.month == 4 || ptime.month == 6 || ptime.month == 9 ||
- ptime.month == 11) && ptime.day > 30))
- {
- ptime.day = 1;
- ptime.month++;
- if (ptime.month > 12)
- {
- ptime.month=1;
- ptime.year++;
- }
- }
- }
ptime.minute-=60;
}
- ptime.second=(png_byte) second;
+ if (ptime.hour > 24)
+ {
+ ptime.day ++;
+ ptime.hour -=24;
+ }
+ /* To do: fix this for leap years */
+ if (ptime.day > 31 || (ptime.month == 2 && ptime.day > 28) ||
+ ((ptime.month == 4 || ptime.month == 6 || ptime.month == 9 ||
+ ptime.month == 11) && ptime.day > 30))
+ {
+ ptime.month++;
+ ptime.day = 1;
+ }
+ if (ptime.month > 12)
+ {
+ ptime.year++;
+ ptime.month=1;
+ }
png_set_tIME(ping,info,&ptime);
}
#endif