[freeside-commits] freeside/FS/bin freeside-pkg-date-midnight, 1.1.2.2, 1.1.2.3

Erik Levinson levinse at wavetail.420.am
Mon Jun 6 09:02:29 PDT 2011


Update of /home/cvs/cvsroot/freeside/FS/bin
In directory wavetail.420.am:/tmp/cvs-serv20261/FS/bin

Modified Files:
      Tag: FREESIDE_2_1_BRANCH
	freeside-pkg-date-midnight 
Log Message:
freeside-pkg-date-midnight: docs, RT12570

Index: freeside-pkg-date-midnight
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/bin/freeside-pkg-date-midnight,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -w -d -r1.1.2.2 -r1.1.2.3
--- freeside-pkg-date-midnight	3 May 2011 17:23:38 -0000	1.1.2.2
+++ freeside-pkg-date-midnight	6 Jun 2011 16:02:27 -0000	1.1.2.3
@@ -5,6 +5,7 @@
 use FS::UID qw(adminsuidsetup);
 use FS::Record qw(qsearch qsearchs dbh);
 use Data::Dumper;
+use Date::Manip::Date;
 use POSIX;
 
 &untaint_argv;	#what it sounds like  (eww)
@@ -25,6 +26,11 @@
     my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
         localtime($bill);
 
+    my $date = new Date::Manip::Date;
+    my $err = $date->parse($bill);
+
+    my $datefixed = $date->calc(?,1);
+
     if ( $hour != 0 || $min != 0 || $sec != 0 ) {
         $hour = 0;
         $min = 0;
@@ -71,12 +77,6 @@
 
 user - name of an internal Freeside user
 
-=head1 BUGS
-
-Will be off by an hour when crossing DST boundaries, defeating the purpose of 
-the util. Workaround: run it a day after each DST change (so twice per year
-for time zones subject to DST).
-
 =head1 SEE ALSO
 
 L<FS::cust_pkg>



More information about the freeside-commits mailing list