HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
MySQL Functions : Return the year part of a date
The YEAR() function returns the year part for a given date (a number from 1000 to 9999).
YEAR(date)
Parameter | Description |
---|---|
date | Required. The date/datetime to extract the year from |
Works in: | From MySQL 4.0 |
---|
Return the year part of a date:
SELECT YEAR("2017-06-15 09:34:21");
Return the year part of the current system date:
SELECT YEAR(CURDATE());