current_datetime(): DateTimeImmutable In this article Table of ContentsReturn Source Related Changelog Copy page View as Markdown Back to top Retrieves the current time as an object using the site’s timezone. Return DateTimeImmutable Date and time object. Source function current_datetime() { return new DateTimeImmutable( 'now', wp_timezone() ); } View all references View on Trac View on GitHub Related UsesDescriptionwp_timezone()wp-includes/functions.phpRetrieves the timezone of the site as a DateTimeZone object. Used byDescriptionwp_dashboard_recent_posts()wp-admin/includes/dashboard.phpGenerates Publishing Soon and Recently Published sections. Changelog VersionDescription5.3.0Introduced. User Contributed Notes You must log in before being able to contribute a note or feedback.
User Contributed Notes
You must log in before being able to contribute a note or feedback.