Home  >  Article  >  Backend Development  >  php基础,该如何解决

php基础,该如何解决

WBOY
WBOYOriginal
2016-06-13 11:51:55802browse

php基础
编写一个函数,使它可以根据传入的指定年周号字符串(如201205)和偏移周数(如25表示后25周,或-25表示前25周)来返回新的年周号字符串.
------解决方案--------------------
date_default_timezone_set('Asia/Shanghai');

$timestamp =  strtotime('2014 + 10 week -20 week');
echo  '2014年第10周减20周的结果是:'.date('Y年W周',$timestamp);
echo  ',timestamp是'.$timestamp;
?>

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