Collections:
DAYOFYEAR() - Day of Year
How to extract the day of year of a given date using the DAYOFYEAR() function?
✍: FYIcenter.com
DAYOFYEAR(date) is a MySQL built-in function that
returns the day of year from a given date.
For example:
SELECT DAYOFYEAR('2023-02-03'), DAYOFYEAR(NOW());
-- +-------------------------+------------------+
-- | DAYOFYEAR('2023-02-03') | DAYOFYEAR(NOW()) |
-- +-------------------------+------------------+
-- | 34 | 318 |
-- +-------------------------+------------------+
Reference information of the DAYOFYEAR() function:
DAYOFYEAR(date): int Returns the day of the year for date, in the range 1 to 366. Arguments, return value and availability: date: Required. The date to extract the day of year from. int: Return value. The day of year. Available since MySQL 4.
Related MySQL functions:
⇒ EXTRACT() - Extracting Datetime Component
⇐ DAYOFWEEK() - Day of Week (1=Sunday)
2023-11-16, 1309🔥, 0💬
Popular Posts:
How To Divide Query Output into Multiple Groups with the GROUP BY Clause in SQL Server? Sometimes, y...
How to check if two JSON values have overlaps using the JSON_OVERLAPS() function? JSON_OVERLAPS(json...
How To Insert New Line Characters into Strings in SQL Server Transact-SQL? If you want to break a st...
How To Select All Columns of All Rows from a Table with a SELECT statement in SQL Server? The simple...
What are DDL (Data Definition Language) statements for tables in SQL Server? DDL (Data Definition La...