🌐 US-Proxy
class="wp-singular wp-parser-function-template-default single single-wp-parser-function postid-126427 wp-embed-responsive wp-theme-wporg-parent-2021 wp-child-theme-wporg-developer-2023">

current_datetime(): DateTimeImmutable

In this article

Retrieves the current time as an object using the site’s timezone.

Return

DateTimeImmutable Date and time object.

Source

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

Changelog

VersionDescription
5.3.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.