current_datetime

函数


current_datetime ( No parameters )
返回值
  • (DateTimeImmutable) Date and time object.
定义位置
  • wp-includes/functions.php
    , line 95
引入
5.3.0
弃用

Retrieves the current time as an object using the site’s timezone.

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