2009-08-31 9 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; 
?> 
関連する問題