How to change default timezone via .htaccess file?

How to change default Time Zone permanently via .htaccess file? [Important| Latest 2019]

We have done so much of hard work and experiments to make this easy for you..

Now in order to set IST timezone via .htaccess file you have to follow few steps which we have discovered [Updated May 2019]

  • Login to your cPanel
  • Go inside File Manager section and go to Public_html
  • Create a file test.php

 Edit this test.php file using the code given below:


<?php

echo “Today is ” . date(“Y/m/d”) . “<br>”;

echo “The time is ” . date(“h:i:sa”);

?>

How to Change Default Timezone in .htaccess| best linux hosting provider
How to Change Default Timezone in .htaccess

Now go inside public_html and Edit .htaccess file  by using the code given below:

<IfModule php5_module>

 php_value date.timezone =”Asia/Kolkata”

</IfModule>

How to Change Default Timezone in .htaccess| cheapest linux hosting provider
How to Change Default Timezone in .htaccess


It’s done!!!!

You can now check it by running the URL from new tab

How to Change Default Timezone in .htaccess| cheapest linux hosting provider
How to Change Default Timezone in .htaccess

There is one more way to do this via MultiPHP INI Editor

  • Simply login to Cpanel and go inside MultiPHP INI editor
  • Click on Editor Mode
  • Select your primary domain and edit a simple code given below and save it.

date.timezone=”Asia/Kolkata”

How to Change Default Timezone in .htaccess| cheapest linux hosting provider
How to Change Default Timezone in .htaccess

This method will also work!!! Try this out

Hope this helps you!!!!

Thanks for Reading!!!!