A WordPress-centric search engine for devs and theme authors



current_datetime ›

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 with the timezone from settings.



Source

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