Subject: | Time::Period v.1.20 and leap years (2 problems) |
Hello,
Your module is great. It is heavily used in our monitoring system (MON) and we use this module to specify periods when to [not] monitor our servers etc due to scheduled downtimes etc.
Time::Period version 1.20.
I am sure, that these two bugs(?) is not OS/Perl version specific.
1) sub getTimeVars
...
($sec, $min, $hr, $md, $mo, $yr, $wd, $yd) = localtime($time);
....
$yr = int($time / 31536000) + 1970;
It'is not correct for the values near the end of EACH year - because it assumes that every year has 365 days (=31536000 seconds). I guess that '$yr+=1900;' will be better solution.
2) Current version of period expression syntax does not support possibility to enter period expressions with last year day of leap-year e.g yd{366}. Places to update:
- inline POD
- sub getTimeVars (comment text)
- sub yd
thanks in advance,
Valdis Pukis
vpukis@inbox.lv