Last active
March 24, 2024 02:12
-
-
Save jasperfrontend/47ebeccd1f0ecb5e12294d07a6e0f723 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Usage: [mytime] | |
Edit the timezone on line 8 to reflect your actual timezone. | |
Find your timezone: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones */ | |
add_shortcode( 'mytime', 'ims_my_time' ); | |
function ims_my_time( $atts ) { | |
$timezone = new DateTimeZone( 'Europe/Amsterdam' ); // edit this | |
$return = wp_date("h:i A", null, $timezone ); | |
return $return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment