hard2learn Posted January 13, 2008 Share Posted January 13, 2008 My question probably won't get answered because really even though I am putting the effort in I just don't get this. I inherited a hockey website that is PHP / mysql. I have learnt to update, a bit of php but nothing like you people I see here. Here is my problem. There is a next game section. It grabs the info from the schedule in the database. The problem is it changes to the "next" game early on game day so everone that looks at the site on the day of the game doesn't get the actual next game which is that night. I am sorry as I am not even sure what info I would need to give you geniuses. I will attach some coding and see if that helps. - Also how would I code for a BOLD "TONIGHT" to show on either a home or away game the day of the game if possible? - I sure appreciate any help. I can get more info if needed. Thanks...John <?php } // Show if recordset not empty ?> <?php if ($totalRows_awayGames > 0) { // Show if recordset not empty ?> <div class="game"> <h2>Next Away Game<a href="schedule.php">schedule ></a></h2> <div class="gameSched"> <?php resizepic(70, 70, "images/team_logos/","griz.gif", "VC", "photo"); ?> vs <?php resizepic(70, 70, "images/team_logos/",$row_awayGames['teamLogo'], $row_awayGames['teamCity'], "photo"); ?> <p><?php echo $row_awayGames['gameTime']; ?></p> <p><?php echo date('l, F d, Y',strtotime($row_awayGames['gameDate'])); ?></p> <p><?php echo $row_awayGames['location']; ?></p> </div> </div> <?php } // Show if recordset not empty ?> Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted January 13, 2008 Share Posted January 13, 2008 Any date conversion in php, using the date() function adjusts the date to the time zone the server is in. If the dates and times are stored in the mysql database using standard mysql DATE or DATETIME data types (and if they are not stored this way you should consider changing them so that they are), you can format them directly in the SELECT query using the mysql DATE_FORMAT() function. If you still want to use the php date() function, you need to set the time zone you want to use in your php script before the date() function is called. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.