current_datetime()

Retrieves the current time as an object with the timezone from settings.


Description


Return

(DateTimeImmutable) Date and time object.


Top ↑

Source

File: wp-includes/functions.php

function current_datetime() {
	return new DateTimeImmutable( 'now', wp_timezone() );
}

Top ↑

Changelog

Version Description
5.3.0 Introduced.