Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Shows the current time in London, when a shortcode is called in WordPress
// Add a shortcode to dispay [now_time] for the time in Europe/London - by Robin Scott of Silicon Dales
function sd_now_time_formated($atts) {
date_default_timezone_set("Europe/London");
$i = date('g:i A');
return $i;
}
add_shortcode('now_time', 'sd_now_time_formated');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.