richiec Posted July 14, 2007 Share Posted July 14, 2007 http://fearedwarlords.dks-gfx.com/timeframe/index.php If you go there you will see that there are some color images and some grayed out versions of the images.. Now if you hover over the color image you will see that it has a time and date. what i want to do is if the time and date is before what it has on the hover over, for it to display the gray image.. if it is after the time and date on there for it to display the color image. Now i have that working ( i think ) with this if(strtotime('now') > strtotime($date $time)) { echo "<a href=\"#\" target=\"_parent\" title=\"$name is due on the $date at $time\"> <img src=\"$image\" />"; } else { echo "<img src='$image2'>"; But that uses unix time, and i need it set to work from a different time zone, does anyone know how i can change that to work from the time zone that i want. Thanks Rich. Link to comment https://forums.phpfreaks.com/topic/59947-solved-strtotime/ Share on other sites More sharing options...
chigley Posted July 14, 2007 Share Posted July 14, 2007 putenv("TZ=Europe/London"); // Put this at the top of your code List of timezones: http://www.php.net/manual/en/timezones.php Link to comment https://forums.phpfreaks.com/topic/59947-solved-strtotime/#findComment-298123 Share on other sites More sharing options...
LiamProductions Posted July 14, 2007 Share Posted July 14, 2007 You might want to fix this page: http://fearedwarlords.dks-gfx.com/timeframe/timessud.php Link to comment https://forums.phpfreaks.com/topic/59947-solved-strtotime/#findComment-298143 Share on other sites More sharing options...
richiec Posted July 14, 2007 Author Share Posted July 14, 2007 putenv("TZ=Europe/London"); // Put this at the top of your code List of timezones: http://www.php.net/manual/en/timezones.php ok with that done i now get an unexpected T_VARIABLE error on this line if(strtotime('now') > strtotime($date $time)) { full part of it with your code is putenv("TZ=America/New_York"); // Put this at the top of your code // if(strtotime('now') > strtotime("$mysql_date $mysql_time")) { if(strtotime('now') > strtotime($date $time)) { echo "<a href=\"#\" target=\"_parent\" title=\"$name is due on the $date at $time\"> <img src=\"$image\" />"; } else { echo "<img src='$image2'>"; } any ideas what i did wrong? You might want to fix this page: http://fearedwarlords.dks-gfx.com/timeframe/timessud.php that page works fine, but you need to be loged in first, once the index.php page is finished it will need to be loged in also to view.. i have just taken that off this page for now untill i get it working right so i can use it as an example to show people what im trying to do. Link to comment https://forums.phpfreaks.com/topic/59947-solved-strtotime/#findComment-298205 Share on other sites More sharing options...
chigley Posted July 14, 2007 Share Posted July 14, 2007 if(strtotime('now') > strtotime("{$date} {$time}")) { Try that Link to comment https://forums.phpfreaks.com/topic/59947-solved-strtotime/#findComment-298206 Share on other sites More sharing options...
redarrow Posted July 14, 2007 Share Posted July 14, 2007 curly {} braces will be replaced in php 6 by [] brackets for future info ok. Link to comment https://forums.phpfreaks.com/topic/59947-solved-strtotime/#findComment-298211 Share on other sites More sharing options...
chigley Posted July 14, 2007 Share Posted July 14, 2007 Cool, never knew that. Got a doc about it I could read? Link to comment https://forums.phpfreaks.com/topic/59947-solved-strtotime/#findComment-298213 Share on other sites More sharing options...
richiec Posted July 14, 2007 Author Share Posted July 14, 2007 Thank you very much for the help, it works great now thanks again Rich. Link to comment https://forums.phpfreaks.com/topic/59947-solved-strtotime/#findComment-298220 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.