From: Davide Franco Date: Wed, 6 Jul 2011 18:48:11 +0000 (+0200) Subject: bacula-web: New function get_Day_Intervals() X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=22021ed129ca39c2100258e9642c503b25a7bc47;p=bacula%2Fbacula bacula-web: New function get_Day_Intervals() - return unix timestamp interval for a day --- 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); + } } ?>