Adding Date/Time with PHP using Code Files

In this video tutorial we show you how to add the current date and time with PHP using Easy Code Manager code files.

Get Current Date – PHP
Main PHP script for your code file

function get_current_date() {
	$date_format = get_option('date_format');
	$time_format = get_option('time_format');
	$date = date("{$date_format} {$time_format}", current_time('timestamp'));
	return $date;
}

Get Current Date
Calling PHP function for your page via shortcode

<?php echo get_current_date(); ?>