2009-08-31 18 views

回答

33

看那功能日期()和的strtotime():

echo date('Y'); 
echo date('Y', strtotime('+1 year')); 
13

您可以使用日期函数来提取日期的部分:

$year = date("Y"); // get the year part of the current date 
$nextYear = $year + 1; 

运行片段here

0

...和strftime('%Y')确实太

6
<?php 
$date="2010-04-30"; 
$y = date('Y',strtotime($date)); 
echo $y; 
?> 
相关问题