search
Homephp教程php手册星期的计算函数

函数

/**
* getDay 返回星期(星期天=0)
* @param
*  $y 年
*  $m 月
*  $d 日
* 假定传入的日期合法
* 计算范围:1752-9-14以后
*/
function getDay($y,$m,$d) {
  if($m==1 || $m==2) {
    $m += 12;
    $y--;
  }
  $t = $d+2*$m+bcdiv(3*($m+1),5,0)+$y+bcdiv($y,4,0)-bcdiv($y,100,0)+bcdiv($y,400,0);
  return ($a+1)%7;
}
?>



Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor