diff --git a/smradius/modules/system/mod_config_sql_topups.pm b/smradius/modules/system/mod_config_sql_topups.pm index 95afbda923cc3af4e1f9d2ac589db6b525d62ea3..281a364dce577a556c28dd8285eb26a917b2acb1 100644 --- a/smradius/modules/system/mod_config_sql_topups.pm +++ b/smradius/modules/system/mod_config_sql_topups.pm @@ -296,7 +296,7 @@ sub cleanup my $now = DateTime->now->set_time_zone($server->{'smradius'}->{'event_timezone'}); # This month.. - my $thisMonth = DateTime->new( year => $now->year, month => $now->month, day => 1 ); + my $thisMonth = $now->clone()->truncate( to => "month" ); # Last month.. my $lastMonth = $thisMonth->clone()->subtract( months => 1 );