php get only year from datetime code example Example: php grab year from date $year = date("y",strtotime($mydate));