Saturday, May 21, 2016

WordPress get current timezone

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.

<?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

MS SQL : How to identify fragmentation in your indexes?

Almost all of us know what fragmentation in SQL indexes are and how it can affect the performance. For those who are new Index fragmentation...