create sub to round times from the code taken from src/lib/TinderDB.pm

git-svn-id: svn://10.0.0.236/trunk@141478 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kestes%walrus.com 2003-04-20 19:35:28 +00:00
parent 51a3f14c12
commit 5b3bb8970f

View File

@ -3,8 +3,8 @@
# Utils.pm - General purpose utility functions. Every project needs a
# kludge bucket for common access.
# $Revision: 1.34 $
# $Date: 2003-04-13 14:13:40 $
# $Revision: 1.35 $
# $Date: 2003-04-20 19:35:28 $
# $Author: kestes%walrus.com $
# $Source: /home/befator/cvs/jail/cvsroot/mozilla/webtools/tinderbox2/src/lib/Utils.pm,v $
# $Name: not supported by cvs2svn $
@ -324,6 +324,21 @@ sub clean_times {
}
# given a time we round down to nearest 5 minutes
sub round_time {
my ($time) = @_;
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime($time);
my $remainder = $min % 5;
$time = $time - ($remainder*$main::SECONDS_PER_MINUTE) - $sec;
return $time;
}
# make a directory (and all of its parents if need be).
# You can optionally specify the permssions for all the directories