PHP Date Timezone error ( date_default_timezone_set )

I was experiencing an error regarding date() function on PHP 5 with error message like this :
Message: date(): 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 'Asia/Jakarta' for 'WIT/7.0/no DST' instead

For quick fix in PHP5, add this line

date_default_timezone_set("Asia/Jakarta")

Leave a Reply

Your email address will not be published. Required fields are marked *