Mod-Jay Posted December 11, 2010 Share Posted December 11, 2010 I have a Xampp Timezone Error Error Warning: strtotime() [function.strtotime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for '-5.0/no DST' instead in C:\Users\cory j\Desktop\xampp\htdocs\NoXIp\Toplist\inc\vote.php on line 56 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' NOW())' at line 1 Line 56 $diffrence = time() - strtotime($getDate['lastVoteDate']); The Date Function in Php.ini [Date] ; Defines the default timezone used by the date functions ; http://php.net/date.timezone date.timezone = "America/New_York" date.timezone = "America/New_York" ; http://php.net/date.default-latitude ;date.default_latitude = 31.7667 ; http://php.net/date.default-longitude ;date.default_longitude = 35.2333 ; http://php.net/date.sunrise-zenith ;date.sunrise_zenith = 90.583333 ; http://php.net/date.sunset-zenith ;date.sunset_zenith = 90.583333 Link to comment https://forums.phpfreaks.com/topic/221319-xampp-timezone-error/ Share on other sites More sharing options...
BlueSkyIS Posted December 11, 2010 Share Posted December 11, 2010 potentially important part of that notice: We selected 'America/New_York' for '-5.0/no DST' instead in C:\Users\cory j\Desktop\xampp\htdocs\NoXIp\Toplist\inc\vote.php on line 56 what's on line 56 of vote.php? Link to comment https://forums.phpfreaks.com/topic/221319-xampp-timezone-error/#findComment-1145756 Share on other sites More sharing options...
Pikachu2000 Posted December 11, 2010 Share Posted December 11, 2010 Either Apache wasn't restarted, or you edited the wrong copy of php.ini, most likely. And why is date.timezone in there twice? Link to comment https://forums.phpfreaks.com/topic/221319-xampp-timezone-error/#findComment-1145759 Share on other sites More sharing options...
Mod-Jay Posted December 11, 2010 Author Share Posted December 11, 2010 potentially important part of that notice: We selected 'America/New_York' for '-5.0/no DST' instead in C:\Users\cory j\Desktop\xampp\htdocs\NoXIp\Toplist\inc\vote.php on line 56 what's on line 56 of vote.php? Are you blind? it says it right there Line 56 Link to comment https://forums.phpfreaks.com/topic/221319-xampp-timezone-error/#findComment-1145778 Share on other sites More sharing options...
BlueSkyIS Posted December 11, 2010 Share Posted December 11, 2010 so line 56 of vote.php says "Line 56"? Well, there's your problem right there. But perhaps I'm not the blind one. the error is telling you straight out that the problem is the use of -5.0/no DST on line 56 of vote.php. Link to comment https://forums.phpfreaks.com/topic/221319-xampp-timezone-error/#findComment-1145781 Share on other sites More sharing options...
Mod-Jay Posted December 11, 2010 Author Share Posted December 11, 2010 so line 56 of vote.php says "Line 56"? Well, there's your problem right there. Wow, You really are blind. Line 56 on Vote.php $diffrence = time() - strtotime($getDate['lastVoteDate']); Link to comment https://forums.phpfreaks.com/topic/221319-xampp-timezone-error/#findComment-1145782 Share on other sites More sharing options...
BlueSkyIS Posted December 11, 2010 Share Posted December 11, 2010 yep, my bad. i didn't see the post. but you didn't have to be such a @$%@ about it. I won't bother trying to help YOU again. meh! Link to comment https://forums.phpfreaks.com/topic/221319-xampp-timezone-error/#findComment-1145783 Share on other sites More sharing options...
Mod-Jay Posted December 11, 2010 Author Share Posted December 11, 2010 yep, my bad. i didn't see the post. but you didn't have to be such a @$%@ about it. I won't bother trying to help YOU again. meh! Yup.. i agree, i wouldn't want to help myself either. I have restarted Apache and it show the same error, Anymore help? Please Link to comment https://forums.phpfreaks.com/topic/221319-xampp-timezone-error/#findComment-1145786 Share on other sites More sharing options...
Pikachu2000 Posted December 11, 2010 Share Posted December 11, 2010 Check the results of phpinfo() to make sure you edited the php.ini file that shows up as the 'Loaded Configuration File'. Link to comment https://forums.phpfreaks.com/topic/221319-xampp-timezone-error/#findComment-1145789 Share on other sites More sharing options...
Mod-Jay Posted December 11, 2010 Author Share Posted December 11, 2010 I did Link to comment https://forums.phpfreaks.com/topic/221319-xampp-timezone-error/#findComment-1145793 Share on other sites More sharing options...
Pikachu2000 Posted December 11, 2010 Share Posted December 11, 2010 See what you get from: echo date_default_timezone_get() Link to comment https://forums.phpfreaks.com/topic/221319-xampp-timezone-error/#findComment-1145797 Share on other sites More sharing options...
Mod-Jay Posted December 11, 2010 Author Share Posted December 11, 2010 Error Warning: date_default_timezone_get() [function.date-default-timezone-get]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for '-5.0/no DST' instead in C:\Users\cory j\Desktop\xampp\htdocs\phpinfo.php on line 3 America/New_York Link to comment https://forums.phpfreaks.com/topic/221319-xampp-timezone-error/#findComment-1145799 Share on other sites More sharing options...
Pikachu2000 Posted December 11, 2010 Share Posted December 11, 2010 You can put it at the top of the script that's giving you problems, or create a new script and paste it in. Link to comment https://forums.phpfreaks.com/topic/221319-xampp-timezone-error/#findComment-1145800 Share on other sites More sharing options...
Mod-Jay Posted December 11, 2010 Author Share Posted December 11, 2010 You can put it at the top of the script that's giving you problems, or create a new script and paste it in. got a(n) Error Link to comment https://forums.phpfreaks.com/topic/221319-xampp-timezone-error/#findComment-1145804 Share on other sites More sharing options...
Pikachu2000 Posted December 11, 2010 Share Posted December 11, 2010 And that error would be what, exactly? Link to comment https://forums.phpfreaks.com/topic/221319-xampp-timezone-error/#findComment-1145805 Share on other sites More sharing options...
Mod-Jay Posted December 11, 2010 Author Share Posted December 11, 2010 Posted it above Link to comment https://forums.phpfreaks.com/topic/221319-xampp-timezone-error/#findComment-1145807 Share on other sites More sharing options...
Pikachu2000 Posted December 11, 2010 Share Posted December 11, 2010 Something isn't adding up here. Have you searched your php.ini file to see if there's a line in it that contains -5.0/no DST? Paste this at the top of the script and see if the error disappears. If it does, either that value in php.ini is being overwritten later in the file, or that php.ini file is not the one being used by php. date_default_timezone_set("America/New_York"); Link to comment https://forums.phpfreaks.com/topic/221319-xampp-timezone-error/#findComment-1145813 Share on other sites More sharing options...
Mod-Jay Posted December 11, 2010 Author Share Posted December 11, 2010 Something isn't adding up here. Have you searched your php.ini file to see if there's a line in it that contains -5.0/no DST? Paste this at the top of the script and see if the error disappears. If it does, either that value in php.ini is being overwritten later in the file, or that php.ini file is not the one being used by php. date_default_timezone_set("America/New_York"); There was no line but i search it with windows 7 and 5 other files came up. i placed that in the php.ini spot where it should go and it still isnt working. i have team viewer if you want to look for yourself Link to comment https://forums.phpfreaks.com/topic/221319-xampp-timezone-error/#findComment-1145818 Share on other sites More sharing options...
Pikachu2000 Posted December 11, 2010 Share Posted December 11, 2010 The line above should go in the script that is generating the error, not in php.ini. Link to comment https://forums.phpfreaks.com/topic/221319-xampp-timezone-error/#findComment-1145823 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.