current_datetime()
Retrieves the current time as an object using the site's timezone.
No Hooks.
Returns
DateTimeImmutable
. Date and time object.
Usage
current_datetime();
Changelog
Since 5.3.0 | Introduced. |
current_datetime() current datetime code WP 6.8.1
function current_datetime() { return new DateTimeImmutable( 'now', wp_timezone() ); }