rest_get_date_with_gmt()
rest_get_date_with_gmt( string $date, bool $is_utc = false )
以MySQL datetime格式将日期解析为其本地和UTC等效值。
Parses a date into both its local and UTC equivalent, in MySQL datetime format.
说明(Description)
另见函数 rest_parse_date()
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$date | (string) | 必需 | RFC3339时间戳。 |
$is_utc | (bool) | 可选 | 提供的日期是否应解释为UTC。 |
返回(Return)
(array|null)本地和UTC日期时间string,采用MySQL日期时间格式(array|null),失败时为空。
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
4.4.0 | wp-includes/rest-api.php:985 | 2 | 3 |
rest_get_date_with_gmt() 为WP2原创文章,链接:https://www.wp2.cn/functions/rest_get_date_with_gmt/