This is a newbie question, I am having some problems with a site I am looking after. There is a list page connected with a detail page on which there is a problem with the time. If I add 00:00 on the content management page, it adds this to the list page with the main events, however on the detail page this shows as 12:00.
Sorry if this is a really obvious thing and also if I have not pasted the right bits of code. Here is the code from the detail page
<?php
$pubdate = $row_revs['evdate'];
$formdate = date('l, jS F Y',$pubdate);
echo $formdate;
?>
</td>
</tr>
<tr>
<td align="right" valign="top" class="formlabelhead">Time:</td>
<td>
<?php
$formdate = date('g.i a',$pubdate);
echo $formdate;
Here is the code from the list page,
$pubdate = $row_revs['ev_date'];
$i = substr($pubdate,14,2);
$h = substr($pubdate,11,2);
$d = substr($pubdate,8,2);
$m = substr($pubdate,5,2);
$y = substr($pubdate,0,4);
echo $d."/".$m."/".$y;
?>
</td>
<td class="headsubtitle"><?php echo $h.":".$i; ?></td>
Thank you for any help. The detail page will only show the wrong time for 00:00 for all other times it shows the right hour. I am wondering if this might be because a previous page in the add/edit part of the site gives all of the times up to and including 23:00 but nothing for 24:00 Have pasted the "add event" code for the time below
<select name="hrs" id="hrs">
<option value="0" <?php if ($h=="00") { echo "selected"; } ?>>00</option>
<option value="1" <?php if ($h=="01") { echo "selected"; } ?>>01</option>
<option value="2" <?php if ($h=="02") { echo "selected"; } ?>>02</option>
<option value="3" <?php if ($h=="03") { echo "selected"; } ?>>03</option>
<option value="4" <?php if ($h=="04") { echo "selected"; } ?>>04</option>
<option value="5" <?php if ($h=="05") { echo "selected"; } ?>>05</option>
<option value="6" <?php if ($h=="06") { echo "selected"; } ?>>06</option>
<option value="7" <?php if ($h=="07") { echo "selected"; } ?>>07</option>
<option value="8" <?php if ($h=="08") { echo "selected"; } ?>>08</option>
<option value="9" <?php if ($h=="09") { echo "selected"; } ?>>09</option>
<option value="10" <?php if ($h=="10") { echo "selected"; } ?>>10</option>
<option value="11" <?php if ($h=="11") { echo "selected"; } ?>>11</option>
<option value="12" <?php if ($h=="12") { echo "selected"; } ?>>12</option>
<option value="13" <?php if ($h=="13") { echo "selected"; } ?>>13</option>
<option value="14" <?php if ($h=="14") { echo "selected"; } ?>>14</option>
<option value="15" <?php if ($h=="15") { echo "selected"; } ?>>15</option>
<option value="16" <?php if ($h=="16") { echo "selected"; } ?>>16</option>
<option value="17" <?php if ($h=="17") { echo "selected"; } ?>>17</option>
<option value="18" <?php if ($h=="18") { echo "selected"; } ?>>18</option>
<option value="19" <?php if ($h=="19") { echo "selected"; } ?>>19</option>
<option value="20" <?php if ($h=="20") { echo "selected"; } ?>>20</option>
<option value="21" <?php if ($h=="21") { echo "selected"; } ?>>21</option>
<option value="22" <?php if ($h=="22") { echo "selected"; } ?>>22</option>
<option value="23" <?php if ($h=="23") { echo "selected"; } ?>>23</option>
</select>
Sorry if this is a really obvious thing and also if I have not pasted the right bits of code. Here is the code from the detail page
<?php
$pubdate = $row_revs['evdate'];
$formdate = date('l, jS F Y',$pubdate);
echo $formdate;
?>
</td>
</tr>
<tr>
<td align="right" valign="top" class="formlabelhead">Time:</td>
<td>
<?php
$formdate = date('g.i a',$pubdate);
echo $formdate;
Here is the code from the list page,
$pubdate = $row_revs['ev_date'];
$i = substr($pubdate,14,2);
$h = substr($pubdate,11,2);
$d = substr($pubdate,8,2);
$m = substr($pubdate,5,2);
$y = substr($pubdate,0,4);
echo $d."/".$m."/".$y;
?>
</td>
<td class="headsubtitle"><?php echo $h.":".$i; ?></td>
Thank you for any help. The detail page will only show the wrong time for 00:00 for all other times it shows the right hour. I am wondering if this might be because a previous page in the add/edit part of the site gives all of the times up to and including 23:00 but nothing for 24:00 Have pasted the "add event" code for the time below
<select name="hrs" id="hrs">
<option value="0" <?php if ($h=="00") { echo "selected"; } ?>>00</option>
<option value="1" <?php if ($h=="01") { echo "selected"; } ?>>01</option>
<option value="2" <?php if ($h=="02") { echo "selected"; } ?>>02</option>
<option value="3" <?php if ($h=="03") { echo "selected"; } ?>>03</option>
<option value="4" <?php if ($h=="04") { echo "selected"; } ?>>04</option>
<option value="5" <?php if ($h=="05") { echo "selected"; } ?>>05</option>
<option value="6" <?php if ($h=="06") { echo "selected"; } ?>>06</option>
<option value="7" <?php if ($h=="07") { echo "selected"; } ?>>07</option>
<option value="8" <?php if ($h=="08") { echo "selected"; } ?>>08</option>
<option value="9" <?php if ($h=="09") { echo "selected"; } ?>>09</option>
<option value="10" <?php if ($h=="10") { echo "selected"; } ?>>10</option>
<option value="11" <?php if ($h=="11") { echo "selected"; } ?>>11</option>
<option value="12" <?php if ($h=="12") { echo "selected"; } ?>>12</option>
<option value="13" <?php if ($h=="13") { echo "selected"; } ?>>13</option>
<option value="14" <?php if ($h=="14") { echo "selected"; } ?>>14</option>
<option value="15" <?php if ($h=="15") { echo "selected"; } ?>>15</option>
<option value="16" <?php if ($h=="16") { echo "selected"; } ?>>16</option>
<option value="17" <?php if ($h=="17") { echo "selected"; } ?>>17</option>
<option value="18" <?php if ($h=="18") { echo "selected"; } ?>>18</option>
<option value="19" <?php if ($h=="19") { echo "selected"; } ?>>19</option>
<option value="20" <?php if ($h=="20") { echo "selected"; } ?>>20</option>
<option value="21" <?php if ($h=="21") { echo "selected"; } ?>>21</option>
<option value="22" <?php if ($h=="22") { echo "selected"; } ?>>22</option>
<option value="23" <?php if ($h=="23") { echo "selected"; } ?>>23</option>
</select>