संभव डुप्लिकेट:
How do I use PHP to get the current year?PHP के साथ वर्ष संख्या कैसे प्राप्त करें?
2009 इस साल 2010 अगले साल।
संभव डुप्लिकेट:
How do I use PHP to get the current year?PHP के साथ वर्ष संख्या कैसे प्राप्त करें?
2009 इस साल 2010 अगले साल।
देखो() और strtotime():
echo date('Y');
echo date('Y', strtotime('+1 year'));
आप एक तिथि का एक हिस्सा निकालने के लिए तिथि समारोह का उपयोग कर सकते हैं:
$year = date("Y"); // get the year part of the current date
$nextYear = $year + 1;
टुकड़ा here चलाएँ।
उपयोग getdate() समारोह कार्यों की तारीख में
... और strftime('%Y')
यह होता भी
<?php
$date="2010-04-30";
$y = date('Y',strtotime($date));
echo $y;
?>
संभावित डुप्लिकेट: http://stackoverflow.com/questions/64003/how-do-i-use-php-to-get-the-current-year –