In WordPress timezone is already set during installation. To get the current timezone in WordPress use the following piece of code.
You can get 2 things.
a) If you want to get the offset use the following code.
You can get 2 things.
a) If you want to get the offset use the following code.
<?php echo get_option('gmt_offset'); ?>
b) If you want to get timezone in string format use the following code.
<?php echo get_option('timezone_string'); ?>
No comments:
Post a Comment