strtotime() it is not safe to rely – error solution

Today in my new PC I was just using a PHP application and I saw a error that says the following error:

PHP Warning: 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

Then I just figured out that I installed the latest version of PHP manually and in my php.ini file I didn’t tell PHP about my default timezone. Now I just open my php.ini file and uncomment the following line:

; Defines the default timezone used by the date functions
date.timezone = Asia/Dhaka

I just uncomment the date.timezone line and assign value Asia/Dhaka as default timezone. To see all supported timezone in PHP, click here

Now this strtotime() it is not safe to rely error solution types of error will be solved.

Shaharia is a professional software engineer with more than 10 years of experience in the relevant fields. Digital ad certified, cloud platform architect, Big data enthusiasts, tech early adopters.

Site Footer