关于PHP读取时间号码有关问题

WBOY
Release: 2016-06-13 11:47:00
Original
891 people have browsed it

关于PHP读取时间号码问题

public function pai3(&$actionNo, &$actionTime, $time=null){<br />		$this->setTimeNo($actionTime, $time);<br />		//echo $actionTime,' ',date('Y-m-d H:i:s', $time);<br />		if($actionTime >= date('Y-m-d H:i:s', $time)){<br />			$actionNo = date('Yz', $time)-6;<br />		}else{<br />			$actionNo = date('Yz', $time)-6;<br />			$actionTime=date('Y-m-d 18:30', $time);<br />		}<br />	}
Copy after login

上面代码读取的年和号,如201456我想改成2014056增加一位,请问怎么改?
------解决方案--------------------
public function pai3(&$actionNo, &$actionTime, $time=null){<br />		$this->setTimeNo($actionTime, $time);<br />		//echo $actionTime,' ',date('Y-m-d H:i:s', $time);<br />		$year = date('Y', $time);<br />		$day = str_pad(date('z',$time),3,'0',STR_PAD_LEFT);<br />		$times = $year.$day;<br />		if($actionTime >= date('Y-m-d H:i:s', $time)){<br />			<br />			$actionNo = $times-6;<br />		}else{<br />			$actionNo = $times-6;<br />			$actionTime=date('Y-m-d 18:30', $time);<br />		}<br />	}
Copy after login

Related labels:
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template