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

Description Description

Return Return

(DateTimeImmutable) Date and time object.

Top ↑

Source Source

File: wp-includes/functions.php

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

Top ↑

Changelog Changelog

Version Description
5.3.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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