makasoft Posted March 27, 2013 Share Posted March 27, 2013 Pls can somebody help me with the date function? Each time I try using it, I get an error that tells me to make use of my system time zones instead Quote Link to comment https://forums.phpfreaks.com/topic/276220-date-function/ Share on other sites More sharing options...
makasoft Posted March 27, 2013 Author Share Posted March 27, 2013 Pls can somebody help me with the date function? Each time I try using it, I get an error that tells me to make use of my system time zones instead Quote Link to comment https://forums.phpfreaks.com/topic/276220-date-function/#findComment-1421400 Share on other sites More sharing options...
Barand Posted March 27, 2013 Share Posted March 27, 2013 (edited) What is the exact error message you are getting? It is probably telling you that you need to call date_default_timezone_set first. To save calling this function every script you can set the timezone in your php.ini file Edited March 27, 2013 by Barand Quote Link to comment https://forums.phpfreaks.com/topic/276220-date-function/#findComment-1421401 Share on other sites More sharing options...
Psycho Posted March 27, 2013 Share Posted March 27, 2013 (edited) Forum Rules: 17. Users should not "bump" topics that are still on the first page of the forums. If you bump, you must provide additional information. If you resort to bumping, chances are your question needs to be re-thought and re-described (see Eric Raymond's "How To Ask Questions The Smart Way"). You seriously bumped your thread after TWO MINUTES? Anyway a quick google search led me to the PHP manual page for date_default_timezone_set() (The actual error message probably would have been faster, but you declined to provide it). On that page is the following information: Note: Since PHP 5.1.0 (when the date/time functions were rewritten), every call to a date/time function will generate a E_NOTICE if the timezone isn't valid, and/or a E_WARNING message if using the system settings or the TZ environment variable. So you should probably use that function to set the timezone in your PHP script. Edited March 27, 2013 by Psycho Quote Link to comment https://forums.phpfreaks.com/topic/276220-date-function/#findComment-1421407 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.