【发布时间】:2010-11-24 06:28:04
【问题描述】:
【问题讨论】:
【问题讨论】:
查看函数 date() 和 strtotime():
echo date('Y');
echo date('Y', strtotime('+1 year'));
【讨论】:
您可以使用日期函数提取日期的一部分:
$year = date("Y"); // get the year part of the current date
$nextYear = $year + 1;
运行 sn-p here。
【讨论】:
<?php
$date="2010-04-30";
$y = date('Y',strtotime($date));
echo $y;
?>
【讨论】:
使用getdate()函数
【讨论】:
...strftime('%Y') 也这样做了
【讨论】: