Insert Current Date and Time Within WordPress

To add the current date and time into a pages and posts on a WordPress site with a shortcode, first add this code to your Theme Functions (functions.php) file.

// Display the Date and Time
function displaydate(){
return date('F jS, Y');
}
add_shortcode('date', 'displaydate');

After you have modified the functions.php file, add the shortcode [date] anywhere you want the date to appear in a page or post. The above code will display the date.

To modify the look of the date and add the time displayed,  refer to the Formatting Date and Time page at WordPress.org.

If you want to display the date in a sidebar, you may need to further hack the Theme Functions file to enable shortcodes in text widgets.