In this tutorial we’ll learn how to get time zone settings in a wordpress site. To achieve this first we need to make sure that our timezone settings have been properly set. To do this navigate to general link under settings tab.
Here you can set the time zone settings for your specific city.
Now let’s say I want to display the timezone settings in the header. We need to add following line of code in the header.php of our file.
<?php echo get_option('timezone_string'); ?>
To access header.php go to editor link under appearance tab and look for header.php
And the line of code as:
Refresh the front end of your site and you’ll see the time zone settings in the header as.