Add more Date/Time Format options to WordPress

If you often customize the date/time formats in WordPress, this might be useful. Just put into your functions.php file and your new formats will be added to the list.

<?php
	add_filter('date_formats', 'add_date_format');
	function add_date_format($original) {
		$more = array('D, M jS, Y');
		return array_merge($original, $more);
	}

	add_filter('time_formats', 'add_time_format');
	function add_time_format($original) {
		$more = array('H:i:s a');
		return array_merge($original, $more);
	}
?>

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: