Home > php教程 > php手册 > php获取指定周的某一天的日期

php获取指定周的某一天的日期

WBOY
Release: 2016-06-07 11:45:05
Original
1401 people have browsed it

php获取指定周的某一天的日期
      /**<br>       * 获取指定周的第几天的日期<br>       * @$year 年,$wek周,$day天,$format显示时间的格式<br>       * @return $str<br>       */<br>     function getWeekDay($year,$week,$day,$format='Y-m-d'){<br>         $time=new DateTime();<br>         $time->setISODate($year,$week,$day);<br>         return $time->format($format);<br>     }如要获取2013年第10周第1天,getWeekDay(2013,10,1);
返回值为:2013-03-4

AD:真正免费,域名+虚机+企业邮箱=0元

source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template