About PHP Read time number problems
Public Function Pai3 (& $actionNo, & $actionTime, $time =null) {
$this->settimeno ($actionTime, $time);
Echo $actionTime, ', date (' y-m-d h:i:s ', $time);
if ($actionTime >= date (' y-m-d h:i:s ', $time)) {
$actionNo = Date (' Yz ', $time)-6;
}else{
$actionNo = Date (' Yz ', $time)-6;
$actionTime =date (' y-m-d 18:30 ', $time);
}
}
The above code read the year and number, such as 201456 I would like to change to 2014056 to increase one, how to change?
------Solution--------------------
Public Function Pai3 (& $actionNo, & $actionTime, $time =null) {
$this->settimeno ($actionTime, $time);
Echo $actionTime, ', date (' y-m-d h:i:s ', $time);
$year = Date (' Y ', $time);
$day = Str_pad (date (' Z ', $time), 3, ' 0 ', str_pad_left);
$times = $year. $day;
if ($actionTime >= date (' y-m-d h:i:s ', $time)) {
$actionNo = $times-6;
}else{
$actionNo = $times-6;
$actionTime =date (' y-m-d 18:30 ', $time);
}
}