Uses
Uses | Description |
---|---|
wp-includes/functions.php: wp_timezone() | Retrieves the timezone from site settings as a |
Retrieves the current time as an object with the timezone from settings.
(DateTimeImmutable) Date and time object.
File: wp-includes/functions.php
function current_datetime() { return new DateTimeImmutable( 'now', wp_timezone() ); }
Version | Description |
---|---|
5.3.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/current_datetime