1/30/2024 0 Comments Convert string to date mysql![]() To get the current year, you use the NOW() function to get the current date and time and pass it to the YEAR() function as follows: SELECT YEAR(NOW()) ![]() The following example uses the YEAR() function to extract the year of January 1st 2017: SELECT YEAR( '') Code language: JavaScript ( javascript )ġ row in set ( 0.00 sec) Code language: SQL (Structured Query Language) ( sql ) Let’s take some examples of using the YEAR() function. If the date is NULL, the YEAR() function returns NULL. If the date is zero, the YEAR() function returns 0. ![]() The YEAR() function returns an integer that represents the year part of the provided date.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |