Algorithm for range of dates
Here is a php function which returns from and to date as an array for a range: <?php function get_rangeof_dates($time_frame = ‘all_time’) { $from_date = ”; $to_date = ”; switch($time_frame) { case ‘all_time’: $from_date = ’1170-01-01 00:00:00′; $to_date = ’2250-12-31 23:59:59′; break; case ‘today’: $from_date = date(‘Y-m-d 00:00:00′); $to_date = date(‘Y-m-d 23:59:59′); [...]

