From 9a55eb6d834ac03de662c66a2b4df2418253bea0 Mon Sep 17 00:00:00 2001 From: Jim Hu Date: Wed, 30 Nov 2005 02:20:32 +0000 Subject: change date calcs in several files for compatibility with some php installs that fail to calculate now+something --- day.php | 4 ++-- functions/ical_parser.php | 2 +- functions/list_functions.php | 2 +- month.php | 2 +- week.php | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/day.php b/day.php index 905c220..0fc8333 100644 --- a/day.php +++ b/day.php @@ -2,7 +2,7 @@ if (isset($_GET['jumpto_day'])) { $jumpto_day_time = strtotime($_GET['jumpto_day']); if ($jumpto_day_time == -1) { - $getdate = date('Ymd', strtotime("now + $second_offset seconds")); + $getdate = date('Ymd', time() + $second_offset); } else { $getdate = date('Ymd', $jumpto_day_time); } @@ -18,7 +18,7 @@ if ($minical_view == 'current') $minical_view = 'day'; $weekstart = 1; $unix_time = strtotime($getdate); -$today_today = date('Ymd', strtotime("now + $second_offset seconds")); +$today_today = date('Ymd', time() + $second_offset); $next_day = date('Ymd', strtotime("+1 day", $unix_time)); $prev_day = date('Ymd', strtotime("-1 day", $unix_time)); diff --git a/functions/ical_parser.php b/functions/ical_parser.php index dc43cc1..5119a1a 100644 --- a/functions/ical_parser.php +++ b/functions/ical_parser.php @@ -49,7 +49,7 @@ if ($save_parsed_cals == 'yes') { $fname = $master_array['-4'][$z]['filename']; $wcalc = $master_array['-4'][$z]['webcal']; if ($wcalc == 'no') $realcal_mtime = filemtime($fname); - $webcal_mtime = strtotime("now -$webcal_hours hours"); + $webcal_mtime = time() - strtotime($webcal_hours * 3600); if (($mtime == $realcal_mtime) && ($wcalc == 'no')) { $y++; } elseif (($wcalc == 'yes') && ($mtime > $webcal_mtime)) { diff --git a/functions/list_functions.php b/functions/list_functions.php index 5d62fb7..a14f5f6 100644 --- a/functions/list_functions.php +++ b/functions/list_functions.php @@ -3,7 +3,7 @@ function list_jumps() { global $second_offset, $lang, $cal; $calName = getCalendarName($cal); - $today = date('Ymd', strtotime("now + $second_offset seconds")); + $today = date('Ymd', time() + $second_offset); $return = ''; $return .= ''; $return .= ''; diff --git a/month.php b/month.php index 0a08ea0..3efc4ac 100644 --- a/month.php +++ b/month.php @@ -13,7 +13,7 @@ $this_month = $day_array2[2]; $this_year = $day_array2[1]; $unix_time = strtotime($getdate); -$today_today = date('Ymd', strtotime("now + $second_offset seconds")); +$today_today = date('Ymd', time() + $second_offset); $tomorrows_date = date('Ymd', strtotime("+1 day", $unix_time)); $yesterdays_date = date('Ymd', strtotime("-1 day", $unix_time)); $sidebar_date = localizeDate($dateFormat_week_list, $unix_time); diff --git a/week.php b/week.php index ed95bd0..5c170ad 100644 --- a/week.php +++ b/week.php @@ -11,7 +11,7 @@ if ($minical_view == "current") $minical_view = "week"; $starttime = "0500"; $weekstart = 1; $unix_time = strtotime($getdate); -$today_today = date('Ymd', strtotime("now + $second_offset seconds")); +$today_today = date('Ymd', time() + $second_offset); $next_week = date("Ymd", strtotime("+1 week", $unix_time)); $prev_week = date("Ymd", strtotime("-1 week", $unix_time)); $next_day = date('Ymd', strtotime("+1 day", $unix_time)); -- cgit v1.2.3