rest_parse_date()
rest_parse_date( string $date, bool $force_utc = false )
将rfc339时间解析为Unix时间戳。
Parses an RFC3339 time into a Unix timestamp.
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$date | (string) | 必需 | RFC3339时间戳。 |
$force_utc | (bool) | 可选 | 是否强制使用UTC时区而不是使用时间戳的时区。 |
返回(Return)
(int)Unix时间戳。
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
4.4.0 | wp-includes/rest-api.php:959 | 2 | 0 |
rest_parse_date() 为WP2原创文章,链接:https://www.wp2.cn/functions/rest_parse_date/