WordPress at a glance
function is not described

current_datetime() WP 5.3.0

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

No Hooks.

Return

DateTimeImmutable. Date and time object.

Usage

current_datetime();

Changelog

Since 5.3.0 Introduced.

Code of current_datetime() WP 5.7.1

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