WordPress函数:calendar_week_mod 计算星期几

江河/ 2023年07月04日/ WordPress/ 浏览 1156

函数原型:


calendar_week_mod( int $num ): float


计算星期几, 即自本周开始的天数。


参数说明:


$num 天数


函数源码:


function calendar_week_mod( $num ) {
	$base = 7;
	return ( $num - $base * floor( $num / $base ) );
}


使用举例:


echo calendar_week_mod( 10 );

// 输出 3


发表评论

暂无评论,抢个沙发...

客服 工单