diff --git a/TimeSeries.pm b/TimeSeries.pm index e8e4976..2933fcf 100644 --- a/TimeSeries.pm +++ b/TimeSeries.pm @@ -598,7 +598,7 @@ sub get_ticks { # 30 ... 90 days: 1 tick/week. my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($firsttime); - $firsttime -= 86400 * $wday; + $firsttime -= 86400 * (($wday + 6) % 7); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($firsttime); $sec = $min = $hour = 0;