use base qw( Exporter );
use vars qw( @EXPORT_OK );
-use POSIX;
use Carp;
+use Time::Local;
use Date::Parse;
use DateTime::Format::Natural;
use FS::Conf;
#carp "WARNING: can't parse date: ". $parser->error;
#return '';
#huh, very common, we still need the "partially" (fully enough for our purposes) parsed date.
- $dt->epoch;
+ return $dt->epoch;
}
} else {
return str2time($string, $tz);
=item day_end TIME
-If the next-bill-ignore-time configuration setting is turned off, just
-returns the passed-in value.
-
-If the next-bill-ignore-time configuration setting is turned on, parses TIME
-as an integer UNIX timestamp and returns a new timestamp with the same date but
-23:59:59 for the time.
+Parses TIME as an integer UNIX timestamp and returns a new timestamp with the
+same date but 23:59:59 for the time.
=cut
sub day_end {
my $time = shift;
- my $conf = new FS::Conf;
- return $time unless $conf->exists('next-bill-ignore-time');
-
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime($time);
- mktime(59,59,23,$mday,$mon,$year,$wday,$yday,$isdst);
+ timelocal(59,59,23,$mday,$mon,$year);
}
=back