From 22021ed129ca39c2100258e9642c503b25a7bc47 Mon Sep 17 00:00:00 2001 From: Davide Franco Date: Wed, 6 Jul 2011 20:48:11 +0200 Subject: [PATCH] bacula-web: New function get_Day_Intervals() - return unix timestamp interval for a day --- gui/bacula-web/includes/utils/ctimeutils.class.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gui/bacula-web/includes/utils/ctimeutils.class.php b/gui/bacula-web/includes/utils/ctimeutils.class.php index 9843c169e2..594d1d7f33 100644 --- a/gui/bacula-web/includes/utils/ctimeutils.class.php +++ b/gui/bacula-web/includes/utils/ctimeutils.class.php @@ -48,6 +48,14 @@ class CTimeUtils { else return $hrsDiff . ':' . $minsDiff . ':' . $secsDiff; } + + static public function get_Day_Intervals( $day ) + { + $start = strtotime( date( "Y-m-d 00:00:00", $day) ); + $end = strtotime( date( "Y-m-d 23:59:59", $day) ); + + return array( 'start' => $start, 'end' => $end); + } } ?> -- 2.39.5