fixed bug 650133

This commit is contained in:
JT Smith 2002-12-10 04:37:28 +00:00
parent b1c01415ac
commit 55cfaa5a4d
2 changed files with 24 additions and 1 deletions

View file

@ -35,6 +35,7 @@ our @EXPORT = qw(&localtime &time &addToTime &addToDate &epochToHuman &epochToSe
use WebGUI::DateTime;
$epoch = WebGUI::DateTime::addToDate($epoch, $years, $months, $days);
$epoch = WebGUI::DateTime::addToTime($epoch, $hours, $minutes, $seconds);
($startEpoch, $endEpoch) = WebGUI::DateTime::dayStartEnd($epoch);
$dateString = WebGUI::DateTime::epochToHuman($epoch, $formatString);
$setString = WebGUI::DateTime::epochToSet($epoch);
$day = WebGUI::DateTime::getDayName($dayInteger);
@ -127,6 +128,26 @@ sub addToTime {
#-------------------------------------------------------------------
=head2 dayStartEnd ( epoch )
Returns the epoch dates for the start and end of the day.
=item epoch
The number of seconds since January 1, 1970.
=cut
sub dayStartEnd {
my ($year,$month,$day, $hour,$min,$sec, $start, $end);
($year,$month,$day, $hour,$min,$sec) = Date::Calc::Time_to_Date($_[0]);
$start = Date::Calc::Date_to_Time($year,$month,$day,0,0,0)-43200;
$end = Date::Calc::Date_to_Time($year,$month,$day,23,59,59);
return ($start, $end);
}
#-------------------------------------------------------------------
=head2 epochToHuman ( [ epoch, format ] )
Returns a formated date string.