{"id":2313,"date":"2020-11-23T04:19:29","date_gmt":"2020-11-23T04:19:29","guid":{"rendered":"https:\/\/ubiq.co\/tech-blog\/?p=2313"},"modified":"2025-08-28T04:47:47","modified_gmt":"2025-08-28T04:47:47","slug":"how-to-change-default-timezone-in-apache-php","status":"publish","type":"post","link":"https:\/\/ubiq.co\/tech-blog\/how-to-change-default-timezone-in-apache-php\/","title":{"rendered":"How to Change Default Timezone in Apache\/PHP"},"content":{"rendered":"\n<p>Every Apache\/PHP system works on a timezone. The default timezone for Apache\/PHP is UTC (Coordinated Universal Time). Sometimes you may need to change Apache\/PHP time zone to sync it with other systems or because your customers are located in a different timezone. In this article, we will look at how to change default timezone in Apache\/PHP. You can use these steps to set Apache\/PHP timezone as per your requirement.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-default-timezone-in-apache-php\/#Why_Change_Default_Timezone_in_Apache\" >Why Change Default Timezone in Apache<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-default-timezone-in-apache-php\/#Change_Default_Timezone_in_ApachePHP\" >Change Default Timezone in Apache\/PHP<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-default-timezone-in-apache-php\/#Change_default_timezone_using_htaccess_file\" >Change default timezone using .htaccess file<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-default-timezone-in-apache-php\/#1_Open_htaccess_file\" >1. Open .htaccess file<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-default-timezone-in-apache-php\/#2_Set_TZ_Variable\" >2. Set TZ Variable<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-default-timezone-in-apache-php\/#3_Restart_Apache_Server\" >3. Restart Apache Server<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-default-timezone-in-apache-php\/#Change_default_timezone_using_phpini\" >Change default timezone using php.ini<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-default-timezone-in-apache-php\/#1_Open_phpini\" >1. Open php.ini<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-default-timezone-in-apache-php\/#2_Change_Time_Zone\" >2. Change Time Zone<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-default-timezone-in-apache-php\/#3_Restart_Apache_Server-2\" >3. Restart Apache Server<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-default-timezone-in-apache-php\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Why_Change_Default_Timezone_in_Apache\"><\/span>Why Change Default Timezone in Apache<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The server timezone is one of the most important parameter in every website and app. It dictates the date and time for almost every thing that happens in your website or app. For example, it decides the datetime values of critical things like user registration, login, sign out, payment, time of browsing, and more. If this is not correct, then your server logs and data will be unreliable. <\/p>\n\n\n\n<p>Also, if it is not as per your requirement, then you will need to convert the datetime values to a different time zone before analyzing it. For example, if you run a local website based out of San Francisco and all your users are located nearby and if your server stores all datetime values in UTC time zone, then you will need to unnecessarily convert all your date to PDT\/PST time zone every single time. Therefore, it is essential to set your server&#8217;s date time to the appropriate value at the time of installation, if not later.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Change_Default_Timezone_in_ApachePHP\"><\/span>Change Default Timezone in Apache\/PHP<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Here is how to set Apache\/PHP timezone. We will look at two ways to set default timezone &#8211; using .htaccess in Apache and using php.ini file in PHP.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Change_default_timezone_using_htaccess_file\"><\/span>Change default timezone using .htaccess file<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In case you don&#8217;t use Apache with PHP, or you don&#8217;t have access to php.ini, you can set default time in Apache web server using .htaccess file. Before proceeding further, please make sure that you have enabled mod_rewrite (.htaccess) on your Apache web server.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Open_htaccess_file\"><\/span>1. Open .htaccess file<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Open .htaccess file, typically located at \/var\/www\/html\/.htaccess<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo vi \/var\/www\/html\/.htaccess<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Set_TZ_Variable\"><\/span>2. Set TZ Variable<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Apache supports numerous environment variables that control the server execution environment. Among them, TZ environment variable contains the time zone information. You can set or reset environment variables using SetEnv directive. Add the following line to set environment variable TZ (for time zone) in Apache web server to Eastern Time zone in US.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SetEnv TZ America\/New_York<\/pre>\n\n\n\n<p>Save and close the file. <\/p>\n\n\n\n<p>In the above line, we specify SetEnv TZ to set time zone environment variable in Apache, followed by &#8216;America\/New York&#8217; to specify Eastern Time. Here is a <a href=\"https:\/\/www.php.net\/manual\/en\/timezones.php\" target=\"_blank\" rel=\"noreferrer noopener\">list<\/a> of all available time zones in Apache\/PHP.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Restart_Apache_Server\"><\/span>3. Restart Apache Server<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Restart Apache Server to apply changes.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo service apache2 restart<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Change_default_timezone_using_phpini\"><\/span>Change default timezone using php.ini<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>If you don&#8217;t have access to .htaccess file or if you use PHP with Apache, then here is how to set default time zone in Apache\/PHP.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Open_phpini\"><\/span>1. Open php.ini<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Open php.ini, typically at \/etc\/php.ini. If you cannot find it then use the &#8216;locate php.ini&#8217; command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo vi \/etc\/php.ini<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Change_Time_Zone\"><\/span>2. Change Time Zone<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>PHP.ini is the main configuration file for PHP. It contains many variables that control the PHP execution environment. Among them, date.timezone stores the value of time zone  used by PHP installation. It is commented by default. Uncomment\/Add the following lines to set default time zone in PHP.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">;<code>[Date] <\/code>\n<code>;date.timezone = UTC<\/code><\/pre>\n\n\n\n<p>Change them to the following, to set default time to Eastern timezone.<\/p>\n\n\n\n<pre id=\"block-73e1d59c-b60b-4831-87de-b4717612cd49\" class=\"wp-block-preformatted\"><code>[Date] <\/code>\n<code>date.timezone = <\/code>America\/New_York<\/pre>\n\n\n\n<p>Save and close the file.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Restart_Apache_Server-2\"><\/span>3. Restart Apache Server<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Restart Apache Server to apply changes.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo service apache2 restart<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>That&#8217;s it. Now your default time zone in Apache will be changed. In this article, we have learnt 2 different ways to set the time zone in Apache\/PHP systems. You can change it either in Apache or PHP. If you want to change it in Apache, then you can do so by modifying .htaccess file. If you want to change it in PHP then modify php.ini file. Between the two solutions, it is advisable to change .htaccess file since PHP is usually handled by programmers and server settings are handled by administrators, and setting server time zone is done by site admins. <\/p>\n\n\n\n<p>As mentioned earlier, it is very important that your server shows the correct date time values otherwise all its actions will be recorded with wrong timestamp. Please note, if you change the server time zone, it will not change any of the past values. It will only start recording future events with the new time zone. So it is advisable to do this at the time of installation itself, if not later.<\/p>\n\n\n\n<p><a href=\"http:\/\/ubiq.co\/\">Ubiq<\/a>&nbsp;makes it easy to visualize data in minutes, and monitor in real-time dashboards.&nbsp;<a href=\"http:\/\/ubiq.co\/accounts\/register\">Try it<\/a>&nbsp;Today!<\/p>\n\n\n\n<p>Also read<br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-custom-404-page-in-apache\/\">How to Create Custom 404 Page in Apache<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-install-mod_security-on-centos-7\/\">How to Install mod_security in CentOS 7<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-create-a-self-signed-ssl-certificate-for-apache-in-ubuntu-debian\/\">How to Create Self-Signed SSL Certificate for Apache<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Default timezone in Apache\/PHP is set to UTC time. Here is how to change default timezone in Apache\/PHP.<\/p>\n","protected":false},"author":1,"featured_media":2316,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3],"tags":[232,233],"class_list":["post-2313","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apache","tag-change-timezone","tag-set-timezone"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Change Default Timezone in Apache\/PHP - Ubiq BI<\/title>\n<meta name=\"description\" content=\"Default timezone in Apache\/PHP is set to UTC time. Here is how to change default timezone in Apache \/ PHP.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-default-timezone-in-apache-php\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Change Default Timezone in Apache\/PHP - Ubiq BI\" \/>\n<meta property=\"og:description\" content=\"Default timezone in Apache\/PHP is set to UTC time. Here is how to change default timezone in Apache \/ PHP.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-default-timezone-in-apache-php\/\" \/>\n<meta property=\"og:site_name\" content=\"Ubiq BI\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ubiqbi\" \/>\n<meta property=\"article:published_time\" content=\"2020-11-23T04:19:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-28T04:47:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/11\/change-default-timezone-apache.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"850\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Sreeram Sreenivasan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:site\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sreeram Sreenivasan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-change-default-timezone-in-apache-php\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-change-default-timezone-in-apache-php\\\/\"},\"author\":{\"name\":\"Sreeram Sreenivasan\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"headline\":\"How to Change Default Timezone in Apache\\\/PHP\",\"datePublished\":\"2020-11-23T04:19:29+00:00\",\"dateModified\":\"2025-08-28T04:47:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-change-default-timezone-in-apache-php\\\/\"},\"wordCount\":817,\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-change-default-timezone-in-apache-php\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/change-default-timezone-apache.jpg?fit=1920%2C850&ssl=1\",\"keywords\":[\"change timezone\",\"set timezone\"],\"articleSection\":[\"Apache\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-change-default-timezone-in-apache-php\\\/\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-change-default-timezone-in-apache-php\\\/\",\"name\":\"How to Change Default Timezone in Apache\\\/PHP - Ubiq BI\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-change-default-timezone-in-apache-php\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-change-default-timezone-in-apache-php\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/change-default-timezone-apache.jpg?fit=1920%2C850&ssl=1\",\"datePublished\":\"2020-11-23T04:19:29+00:00\",\"dateModified\":\"2025-08-28T04:47:47+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"description\":\"Default timezone in Apache\\\/PHP is set to UTC time. Here is how to change default timezone in Apache \\\/ PHP.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-change-default-timezone-in-apache-php\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-change-default-timezone-in-apache-php\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-change-default-timezone-in-apache-php\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/change-default-timezone-apache.jpg?fit=1920%2C850&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/change-default-timezone-apache.jpg?fit=1920%2C850&ssl=1\",\"width\":1920,\"height\":850,\"caption\":\"change default timezone in Apache\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-change-default-timezone-in-apache-php\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Change Default Timezone in Apache\\\/PHP\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\",\"name\":\"Ubiq BI\",\"description\":\"Build dashboards &amp; reports in minutes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\",\"name\":\"Sreeram Sreenivasan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"caption\":\"Sreeram Sreenivasan\"},\"description\":\"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/sreeram-sreenivasan\\\/\"],\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/author\\\/wordpress\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Change Default Timezone in Apache\/PHP - Ubiq BI","description":"Default timezone in Apache\/PHP is set to UTC time. Here is how to change default timezone in Apache \/ PHP.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ubiq.co\/tech-blog\/how-to-change-default-timezone-in-apache-php\/","og_locale":"en_US","og_type":"article","og_title":"How to Change Default Timezone in Apache\/PHP - Ubiq BI","og_description":"Default timezone in Apache\/PHP is set to UTC time. Here is how to change default timezone in Apache \/ PHP.","og_url":"https:\/\/ubiq.co\/tech-blog\/how-to-change-default-timezone-in-apache-php\/","og_site_name":"Ubiq BI","article_publisher":"https:\/\/www.facebook.com\/ubiqbi","article_published_time":"2020-11-23T04:19:29+00:00","article_modified_time":"2025-08-28T04:47:47+00:00","og_image":[{"width":1920,"height":850,"url":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/11\/change-default-timezone-apache.jpg","type":"image\/jpeg"}],"author":"Sreeram Sreenivasan","twitter_card":"summary_large_image","twitter_creator":"@UbiqBI","twitter_site":"@UbiqBI","twitter_misc":{"Written by":"Sreeram Sreenivasan","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-change-default-timezone-in-apache-php\/#article","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-change-default-timezone-in-apache-php\/"},"author":{"name":"Sreeram Sreenivasan","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"headline":"How to Change Default Timezone in Apache\/PHP","datePublished":"2020-11-23T04:19:29+00:00","dateModified":"2025-08-28T04:47:47+00:00","mainEntityOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-change-default-timezone-in-apache-php\/"},"wordCount":817,"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-change-default-timezone-in-apache-php\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/11\/change-default-timezone-apache.jpg?fit=1920%2C850&ssl=1","keywords":["change timezone","set timezone"],"articleSection":["Apache"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-change-default-timezone-in-apache-php\/","url":"https:\/\/ubiq.co\/tech-blog\/how-to-change-default-timezone-in-apache-php\/","name":"How to Change Default Timezone in Apache\/PHP - Ubiq BI","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-change-default-timezone-in-apache-php\/#primaryimage"},"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-change-default-timezone-in-apache-php\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/11\/change-default-timezone-apache.jpg?fit=1920%2C850&ssl=1","datePublished":"2020-11-23T04:19:29+00:00","dateModified":"2025-08-28T04:47:47+00:00","author":{"@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"description":"Default timezone in Apache\/PHP is set to UTC time. Here is how to change default timezone in Apache \/ PHP.","breadcrumb":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-change-default-timezone-in-apache-php\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ubiq.co\/tech-blog\/how-to-change-default-timezone-in-apache-php\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-change-default-timezone-in-apache-php\/#primaryimage","url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/11\/change-default-timezone-apache.jpg?fit=1920%2C850&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/11\/change-default-timezone-apache.jpg?fit=1920%2C850&ssl=1","width":1920,"height":850,"caption":"change default timezone in Apache"},{"@type":"BreadcrumbList","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-change-default-timezone-in-apache-php\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ubiq.co\/tech-blog\/"},{"@type":"ListItem","position":2,"name":"How to Change Default Timezone in Apache\/PHP"}]},{"@type":"WebSite","@id":"https:\/\/ubiq.co\/tech-blog\/#website","url":"https:\/\/ubiq.co\/tech-blog\/","name":"Ubiq BI","description":"Build dashboards &amp; reports in minutes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ubiq.co\/tech-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc","name":"Sreeram Sreenivasan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","caption":"Sreeram Sreenivasan"},"description":"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.","sameAs":["https:\/\/www.linkedin.com\/in\/sreeram-sreenivasan\/"],"url":"https:\/\/ubiq.co\/tech-blog\/author\/wordpress\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/11\/change-default-timezone-apache.jpg?fit=1920%2C850&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pbGGTT-Bj","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/2313","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/comments?post=2313"}],"version-history":[{"count":14,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/2313\/revisions"}],"predecessor-version":[{"id":9304,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/2313\/revisions\/9304"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media\/2316"}],"wp:attachment":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media?parent=2313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/categories?post=2313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/tags?post=2313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}