[mythtv-users] MythWEB issues
James Knight
foom at fuhm.net
Mon Jun 16 21:21:20 EDT 2003
This patch seems to fix the fix conflicts page. I took this information
from the PHP webpage on date. I know nearly no PHP, but worksforme.
James
Index: functions.php
===================================================================
RCS file: /var/lib/mythcvs/mythweb/functions.php,v
retrieving revision 1.16
diff -u -r1.16 functions.php
--- functions.php 10 Jun 2003 15:40:10 -0000 1.16
+++ functions.php 17 Jun 2003 00:19:44 -0000
@@ -998,7 +998,11 @@
}
function getUnixTime($mythtime) {
- return strtotime("$mythtime");
+ list($year,$month,$day,$hour,$minute,$second) =
split("[-:T\.]",$mythtime);
+ // TODO: if(($year < 100) and (strlen($year) == 4))
+ // then I shouldn't get the current century.
+ // Don't know how to pass this to strtotime.
+ return strtotime("$year-$month-$day $hour:$minute:$second");
}
function makeActive($chanid,$starttime,$endtime) {
@@ -1030,8 +1034,7 @@
}
function formatConflictTime($theTime) {
- $theTime = explode(" ",$theTime);
- $theTime = date("YmdHis",strtotime("$theTime[0], $theTime[1]
$theTime[2] $theTime[4] $theTime[3]","\n"));
+ $theTime = date("Y-m-d\TH:i:s",getUnixTime($theTime));
return $theTime;
}
On Monday, June 9, 2003, at 12:40 PM, Robert Kulagowski wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>> $recs[$t][11] and $recs[$t][12] return the start and
>> endtimes. Somehow on my
>> system, the strings are coming back as 2003-06-09T14:00:00. I
>> don't know
>> where the T comes from but it seems to be the root of the problem.
>
> That looks like an ISO-8601 formatted date / time string.
More information about the mythtv-users
mailing list