Browsing articles in "Date & Time"
Feb
28
2011

Set timezone in .htaccess for PHP

PHP Icon

Article on how to set the timezone in the htaccess file for PHP

Nov
8
2010

strtotime with UK date

PHP Icon

Info on how to use strtotime with UK date formats

Sep
30
2010

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

Getting this in a PHP site I am writing, to fix add this to a common include on your PHP page: date_default_timezone_set(‘UTC’);

Jul
19
2010

PHP Format DateTime for MySql

Was adding a date from a service to MySql using PHP and needed something to convert the PHP string into something MySql could use for a DateTime field. This worked a treat: $reviewDateSql = date(‘Y-m-d H:i:s’,strtotime(“$reviewDate”));