Accessing Examples from Editor extension throws DateTime usage warning
Accessing Examples from Editor extension throws DateTime usage warning
medusa101
Posts: 10Questions: 0Answers: 0
Hi,
When I access any of the examples of Editor extension, the browser throws the following error.
=======
DataTables warning: table id=example - DateTime::__construct(): 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone.
All the non-Editor examples from base Datatables package work all right.
Any suggestions? I have set the date.timezone="Asia/Kolkata" in php.ini
Regards
Adi
This discussion has been closed.
Replies
Hi Adi,
We just had a little discussion about this via e-mail, but in case anyone else comes across this page, here is my answer:
The error you are seeing indicates that the PHP install is not complete and the warning is coming from PHP when a date or time method is used. The best way to deal with this error is to set the
date.timezone
property in your php.ini file on your server. Failing that thedate_default_timezone_set
method can be used in PHP.The PHP documentation contains further information/
Allan
Thanks Allan for the extremely quick response. For others who may visit this page, here are a couple of things you should make sure.
You are editing the correct php.ini. Both Linux and Mac OS comes with default PHP deployment and a default Apache installation. So if you have done a fresh installation and are using that ensure the correct php.ini is edited.
Make sure you put a valid timezone from http://php.net/manual/en/timezones.php
Last but not the least remember to uncomment the line which is usually commented in php.ini. :)