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, 934🔥, 0💬
Popular Posts:
How to download Microsoft SQL Server 2005 Express Edition in SQL Server? Microsoft SQL Server 2005 E...
How to download and install Microsoft SQL Server Management Studio Express in SQL Server? Microsoft ...
How To Get Year, Month and Day Out of DATETIME Values in SQL Server Transact-SQL? You can use DATEPA...
How to put statements into a statement block in SQL Server Transact-SQL? You can put statements into...
Where to find tutorials to answer some frequently asked questions on Microsoft SQL Server Transact-S...