year of date php code example Example 1: php get year <?php echo date("Y"); ?> Example 2: php grab year from date $year = date("y",strtotime($mydate));