date display problem (gmdate ... as expected)[SOLVED]
Posted: Mon Oct 13, 2003 10:00 pm
bebugging print out:and the display code:the entry that got the dates at the begining were made at 10:16 est. i'm in est. i don't get why all of tose failed. i want to be able to make the times so it's irrelevant where i host the site, the display is local to the person viewing.
and the actual print out:debug: final time: 10/11/2003 18:16:18
rel date: 10/11/2003 14:16:18
adjusted rel date: 10/11/2003 09:16:18
the issue is that it saves the time as gmt, and the print out is off no matter what. the code to get the save date:sick sick sick... 10/11/2003 13:16:18
Code: Select all
$made=gmdate("Y-m-d H:i:s", time()); # find the dateCode: Select all
}elseif($fn=='list'){ # showing entry list
$entries=mysql_query("SELECT beid,title,UNIX_TIMESTAMP(made) FROM blog WHERE buid='$buid' ORDER BY made DESC", $db);
while($entry=mysql_fetch_array($entries)){ # while we can get entries
$date=gmdate($utds, ($entry['UNIX_TIMESTAMP(made)']+($gmto*60*60))); # format the date of the entry
$fd=gmdate($utds, $entry['UNIX_TIMESTAMP(made)']); # date without gmt offset (gmt time)
$rd=date($utds, $entry['UNIX_TIMESTAMP(made)']); # date without gmt offset (local time)
$rdo=date($utds, ($entry['UNIX_TIMESTAMP(made)']+($gmto*60*60))); # date with gmt offset (local time)
$el.=" <tr>
<td class="abcen"><a href="{$_SERVER['PHP_SELF']}?fn=show&buid=$buid&entry={$entry['beid']}" target="show"{$entry['title']}</a></td>
<td class="abcen">$date</td>
</tr>\n"; # create the entry listing
}
if($el!=''){ $disp=$el; } # make sure we display the right thing
bgnpg("Displaying Journal Entries for $mtd");
echo <<<END
$tsw100
<p>debug: final time: $fd <br /> rel date: $rd <br />adjusted rel date: $rdo</p>
$disp
</table>
END;
clspg();
}else{ # make the main page