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

This commit is contained in:
kestes%walrus.com 2003-04-20 19:35:28 +00:00
Родитель b3592dd9b3
Коммит a0173fb3d6
1 изменённых файлов: 17 добавлений и 2 удалений

Просмотреть файл

@ -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/hwine/cvs_conversion/cvsroot/mozilla/webtools/tinderbox2/src/lib/Utils.pm,v $
# $Name: $
@ -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