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, 1163🔥, 0💬
Popular Posts:
How To View Data Files in the Current Database in Oracle? If you want to get a list of all tablespac...
How To Use SQL*Plus Built-in Timers in Oracle? If you don't have a stopwatch/timer and want to measu...
How To Convert Character Strings into Numeric Values in SQL Server Transact-SQL? Sometimes you need ...
What Is the Difference Between GETDATE() and GETUTCDATE() in SQL Server Transact-SQL? The difference...
How to download and install SQL Server 2005 Sample Scripts in SQL Server? If you want to learn from ...