{"id":65794,"date":"2016-11-25T09:07:12","date_gmt":"2016-11-25T09:07:12","guid":{"rendered":"http:\/\/webkul.com\/blog\/?p=65794"},"modified":"2018-03-20T10:23:58","modified_gmt":"2018-03-20T10:23:58","slug":"convert-server-time-joomla-timezone","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/convert-server-time-joomla-timezone\/","title":{"rendered":"Convert Server Time to Joomla Timezone"},"content":{"rendered":"<h3>How To Set Your Joomla Time Zone<\/h3>\n<ol>\n<li>Log into your Joomla 3.x administrator Dashboard.<\/li>\n<li>In the left menu, click the Global Configuration link.<\/li>\n<li>In the list of tabs towards the top of the page, click the Server tab.<\/li>\n<li>Under the Location Settings heading, find the Server Time Zone setting.<\/li>\n<li>Select timezone from dropdown<\/li>\n<\/ol>\n<p>we can get current time in joomla according to the configuration of joomla server timezone.<br \/>\nBecause your host provider have set timezone might be different.<br \/>\nNow if you need to get current time of timezone asia\/kolkata which you have set in your joomla backend server configuration.<br \/>\neg: if your server host provider&#8217;s timezone African.<br \/>\n\/\/ if Server timezone set as africa\/capetown then it will return instance of jdate class with african timezone<br \/>\neg: $jDate=JFactory::getDate();<br \/>\n$jdate is an object of JDate class of Joomla<\/p>\n<h3>JDate:<\/h3>\n<p>This is a class that stores a date and provides logic to manipulate and render that date in a variety of formats.<br \/>\nAnother way instantiate this class is<br \/>\n$jdate=new JDate();<\/p>\n<pre class=\"brush:php\">    \/\/get Configuration of joomla site    \r\n      $config = JFactory::getConfig();  \r\n      \/\/ $config is an object of JConfig class of Joomla.this object contain all configuration parameter of this Joomla site.You can access every parameter of configuration by use get method of this object\r\n\/\/eg: here we need offset so we can access this like $config-&gt;get('offset');\r\n\/\/get instance of JDate class\r\n       $jDate=JFactory::getDate();  \r\n    \/\/get offset of joomla it will be return value like asia\/kolkata\r\n      $site_offset = $config-&gt;get('offset');    \r\n    \/\/get instance of joomla JDate Class   \r\n    \/\/if you don't pass timestamps as first argument then it will take default argument value current timestamps,you can pass here formatted time value.Second parameter is timezone if you don't pass this it will be take default argument value of your server timezone.                                    \r\n      $jdate=JFactory::getDate('now',$site_offset);  \r\n   \r\n    \/\/ first argument now give me current time-stamp you also can pass time-stamp   \r\n        \r\n    \/\/ second parameter is offset i.e. time zone like asia\/kolkata   \r\n      $jdate-&gt;format('Y-m-d H:i:s',true);\r\n    \/\/get converted time as your joomla configuration<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>How To Set Your Joomla Time Zone Log into your Joomla 3.x administrator Dashboard. In the left menu, click the Global Configuration link. In the list of tabs towards the top of the page, click the Server tab. Under the Location Settings heading, find the Server Time Zone setting. Select timezone from dropdown we can <a href=\"https:\/\/webkul.com\/blog\/convert-server-time-joomla-timezone\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":45,"featured_media":65797,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,13],"tags":[3,90,2057,3114,1046],"class_list":["post-65794","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-joomla-2","category-php","tag-joomla","tag-mysql","tag-php","tag-timezone","tag-webserver"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Convert Server Time to Joomla Timezone - Webkul Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/convert-server-time-joomla-timezone\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Convert Server Time to Joomla Timezone - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"How To Set Your Joomla Time Zone Log into your Joomla 3.x administrator Dashboard. In the left menu, click the Global Configuration link. In the list of tabs towards the top of the page, click the Server tab. Under the Location Settings heading, find the Server Time Zone setting. Select timezone from dropdown we can [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/convert-server-time-joomla-timezone\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/kailashchandradhoulakhandi\" \/>\n<meta property=\"article:published_time\" content=\"2016-11-25T09:07:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-03-20T10:23:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/11\/Joomla-Code-Snippet.png\" \/>\n\t<meta property=\"og:image:width\" content=\"825\" \/>\n\t<meta property=\"og:image:height\" content=\"260\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Kailash Chandra\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kailash Chandra\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/convert-server-time-joomla-timezone\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/convert-server-time-joomla-timezone\/\"},\"author\":{\"name\":\"Kailash Chandra\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/07afa2c65f134699062871eaf4a83f02\"},\"headline\":\"Convert Server Time to Joomla Timezone\",\"datePublished\":\"2016-11-25T09:07:12+00:00\",\"dateModified\":\"2018-03-20T10:23:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/convert-server-time-joomla-timezone\/\"},\"wordCount\":177,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/convert-server-time-joomla-timezone\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/11\/Joomla-Code-Snippet.png\",\"keywords\":[\"joomla\",\"mysql\",\"PHP\",\"timezone\",\"webserver\"],\"articleSection\":[\"Joomla\",\"php\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/convert-server-time-joomla-timezone\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/convert-server-time-joomla-timezone\/\",\"url\":\"https:\/\/webkul.com\/blog\/convert-server-time-joomla-timezone\/\",\"name\":\"Convert Server Time to Joomla Timezone - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/convert-server-time-joomla-timezone\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/convert-server-time-joomla-timezone\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/11\/Joomla-Code-Snippet.png\",\"datePublished\":\"2016-11-25T09:07:12+00:00\",\"dateModified\":\"2018-03-20T10:23:58+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/convert-server-time-joomla-timezone\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/convert-server-time-joomla-timezone\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/convert-server-time-joomla-timezone\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/11\/Joomla-Code-Snippet.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/11\/Joomla-Code-Snippet.png\",\"width\":825,\"height\":260},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/convert-server-time-joomla-timezone\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Convert Server Time to Joomla Timezone\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/07afa2c65f134699062871eaf4a83f02\",\"name\":\"Kailash Chandra\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ea77fb0ff5d7b6f68e2a9186ef37f39b3698bb628b47c1c40f9c31704b910158?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ea77fb0ff5d7b6f68e2a9186ef37f39b3698bb628b47c1c40f9c31704b910158?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Kailash Chandra\"},\"description\":\"Kailash Chandra is a 9x Salesforce Certified professional with experience in Health Cloud, Heroku and Agile Jenkins. He specialises in AppExchange application development, Commerce Cloud, and PMD, providing innovative solutions that improve business operations and drive strategic growth inside the Salesforce ecosystem.\",\"sameAs\":[\"https:\/\/www.facebook.com\/kailashchandradhoulakhandi\"],\"url\":\"https:\/\/webkul.com\/blog\/author\/kailash\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Convert Server Time to Joomla Timezone - Webkul Blog","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:\/\/webkul.com\/blog\/convert-server-time-joomla-timezone\/","og_locale":"en_US","og_type":"article","og_title":"Convert Server Time to Joomla Timezone - Webkul Blog","og_description":"How To Set Your Joomla Time Zone Log into your Joomla 3.x administrator Dashboard. In the left menu, click the Global Configuration link. In the list of tabs towards the top of the page, click the Server tab. Under the Location Settings heading, find the Server Time Zone setting. Select timezone from dropdown we can [...]","og_url":"https:\/\/webkul.com\/blog\/convert-server-time-joomla-timezone\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_author":"https:\/\/www.facebook.com\/kailashchandradhoulakhandi","article_published_time":"2016-11-25T09:07:12+00:00","article_modified_time":"2018-03-20T10:23:58+00:00","og_image":[{"width":825,"height":260,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/11\/Joomla-Code-Snippet.png","type":"image\/png"}],"author":"Kailash Chandra","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Kailash Chandra","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/convert-server-time-joomla-timezone\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/convert-server-time-joomla-timezone\/"},"author":{"name":"Kailash Chandra","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/07afa2c65f134699062871eaf4a83f02"},"headline":"Convert Server Time to Joomla Timezone","datePublished":"2016-11-25T09:07:12+00:00","dateModified":"2018-03-20T10:23:58+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/convert-server-time-joomla-timezone\/"},"wordCount":177,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/convert-server-time-joomla-timezone\/#primaryimage"},"thumbnailUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/11\/Joomla-Code-Snippet.png","keywords":["joomla","mysql","PHP","timezone","webserver"],"articleSection":["Joomla","php"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/convert-server-time-joomla-timezone\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/convert-server-time-joomla-timezone\/","url":"https:\/\/webkul.com\/blog\/convert-server-time-joomla-timezone\/","name":"Convert Server Time to Joomla Timezone - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/convert-server-time-joomla-timezone\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/convert-server-time-joomla-timezone\/#primaryimage"},"thumbnailUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/11\/Joomla-Code-Snippet.png","datePublished":"2016-11-25T09:07:12+00:00","dateModified":"2018-03-20T10:23:58+00:00","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/convert-server-time-joomla-timezone\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/convert-server-time-joomla-timezone\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/convert-server-time-joomla-timezone\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/11\/Joomla-Code-Snippet.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/11\/Joomla-Code-Snippet.png","width":825,"height":260},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/convert-server-time-joomla-timezone\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Convert Server Time to Joomla Timezone"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/07afa2c65f134699062871eaf4a83f02","name":"Kailash Chandra","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/ea77fb0ff5d7b6f68e2a9186ef37f39b3698bb628b47c1c40f9c31704b910158?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ea77fb0ff5d7b6f68e2a9186ef37f39b3698bb628b47c1c40f9c31704b910158?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Kailash Chandra"},"description":"Kailash Chandra is a 9x Salesforce Certified professional with experience in Health Cloud, Heroku and Agile Jenkins. He specialises in AppExchange application development, Commerce Cloud, and PMD, providing innovative solutions that improve business operations and drive strategic growth inside the Salesforce ecosystem.","sameAs":["https:\/\/www.facebook.com\/kailashchandradhoulakhandi"],"url":"https:\/\/webkul.com\/blog\/author\/kailash\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/65794","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/45"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=65794"}],"version-history":[{"count":10,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/65794\/revisions"}],"predecessor-version":[{"id":66772,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/65794\/revisions\/66772"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media\/65797"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=65794"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=65794"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=65794"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}