get_weekstartend
函数
get_weekstartend ( $mysqlstring, $start_of_week = '' )
- 参数
-
-
(string)
$mysqlstring
Date or datetime field type from MySQL.- Required: 是
-
(int|string)
$start_of_week
Optional. Start of the week as an integer. Default empty string.- Required: 否
- Default: (empty)
-
(string)
- 返回值
-
- (int[]) { Week start and end dates as Unix timestamps. @type int $start The week start date as a Unix timestamp. @type int $end The week end date as a Unix timestamp. }
- 定义位置
-
-
wp-includes/functions.php
, line 584
-
wp-includes/functions.php
- 引入
- 0.71
- 弃用
- –
Gets the week start and end from the datetime or date string from MySQL.
function get_weekstartend( $mysqlstring, $start_of_week = '' ) {
// MySQL string year.
$my = substr( $mysqlstring, 0, 4 );
// MySQL string month.
$mm = substr( $mysqlstring, 8, 2 );
// MySQL string day.
$md = substr( $mysqlstring, 5, 2 );
// The timestamp for MySQL string day.
$day = mktime( 0, 0, 0, $md, $mm, $my );
// The day of the week from the timestamp.
$weekday = gmdate( 'w', $day );
if ( ! is_numeric( $start_of_week ) ) {
$start_of_week = get_option( 'start_of_week' );
}
if ( $weekday
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。


