[geeklog-cvs] geeklog: Windows web servers do not support the %e in strftime f...
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Fri May 13 14:30:40 EDT 2011
changeset 8275:72b78ae05a54
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/72b78ae05a54
user: Tom <websitemaster at cogeco.net>
date: Fri May 13 10:24:41 2011 -0400
description:
Windows web servers do not support the %e in strftime function. Bug #1340
diffstat:
public_html/calendar/index.php | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diffs (30 lines):
diff -r 20d7cfd5e037 -r 72b78ae05a54 public_html/calendar/index.php
--- a/public_html/calendar/index.php Fri May 13 10:20:52 2011 -0400
+++ b/public_html/calendar/index.php Fri May 13 10:24:41 2011 -0400
@@ -658,14 +658,24 @@
$time_day1 = mktime (0, 0, 0, $month, $day + 1, $year);
$time_day7 = mktime (0, 0, 0, $month, $day + 7, $year);
$start_mname = strftime ('%B', $time_day1);
- $eday = strftime ('%e', $time_day7);
+ // Check for Windows to find and replace the %e
+ if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
+ $eday = strftime ('%#d', $time_day7);
+ } else {
+ $eday = strftime ('%e', $time_day7);
+ }
$end_mname = strftime ('%B', $time_day7);
$end_ynum = strftime ('%Y', $time_day7);
$date_range = $start_mname . ' ' . strftime ('%e', $time_day1);
} else {
$start_mname = strftime ('%B', mktime (0, 0, 0, $month, $day, $year));
$time_day6 = mktime (0, 0, 0, $month, $day + 6, $year);
- $eday = strftime ('%e', $time_day6);
+ // Check for Windows to find and replace the %e
+ if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
+ $eday = strftime ('%#d', $time_day6);
+ } else {
+ $eday = strftime ('%e', $time_day6);
+ }
$end_mname = strftime ('%B', $time_day6);
$end_ynum = strftime ('%Y', $time_day6);
$date_range = $start_mname . ' ' . $day;
More information about the geeklog-cvs
mailing list