Tuesday, March 21, 2023

Set local timezone in wordpress programatically

Set local timezone in wordpress programatically:

add_action('wp_loaded', 'animed_time_zone_function');
function animed_time_zone_function() {
    $timezone_identifier = 'Asia/Dhaka';
    date_default_timezone_set($timezone_identifier);
}

Happy coding!

No comments:

Post a Comment

Suomen kieli (Imperfekti)

In Finnish, the imperfekti is the past tense that describes actions that happened in the past, like the English simple past (e.g., "I ...