From 05d241c1d1f19c537495231c627d303b3191ca81 Mon Sep 17 00:00:00 2001
From: Robert Anderson <randerson@lbsd.net>
Date: Thu, 13 Oct 2011 11:43:40 +0000
Subject: [PATCH] Base second datetime object off the first, but use ->truncate
 instead. This passes the timezone to the next object via clone().

---
 smradius/modules/system/mod_config_sql_topups.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/smradius/modules/system/mod_config_sql_topups.pm b/smradius/modules/system/mod_config_sql_topups.pm
index 95afbda9..281a364d 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 );
-- 
GitLab