wpseek.com
A WordPress-centric search engine for devs and theme authors



current_datetime › WordPress Function

Since5.3.0
Deprecatedn/a
current_datetime ( No parameters )
Returns:
  • (DateTimeImmutable) Date and time object.
Defined at:
Codex:

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



Source

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