Collections:
TO_DAYS() - Converting Date to Days
How to convert a date value into days since year 0 using the TO_DAYS() function?
✍: FYIcenter.com
TO_DAYS(date) is a MySQL built-in function that
converts a date value into days since year 0.
For example:
SELECT TO_DAYS('1995-05-01'), TO_DAYS(950501);
-- +-----------------------+-----------------+
-- | TO_DAYS('1995-05-01') | TO_DAYS(950501) |
-- +-----------------------+-----------------+
-- | 728779 | 728779 |
-- +-----------------------+-----------------+
Reference information of the TO_DAYS() function:
TO_DAYS(date): int Given a date date, returns a day number (the number of days since year 0). Arguments, return value and availability: date: Required. The date value to be converted. int: Return value. The number of days since year 0. Available since MySQL 4.
Related MySQL functions:
⇒ TO_SECONDS() - Converting Datetime to seconds
⇐ TIME_TO_SEC() - Converting Time to Seconds
2023-11-17, 1222🔥, 0💬
Popular Posts:
How to run Queries with SQL Server Management Studio Express in SQL Server? 1. Launch and connect SQ...
How To Convert Character Strings into Numeric Values in SQL Server Transact-SQL? Sometimes you need ...
What Is Program Global Area (PGA) in Oracle? A Program Global Area (PGA) is a memory buffer that is ...
How To Use DATEADD() Function in SQL Server Transact-SQL? DATEADD() is a very useful function for ma...
How To Provide Default Values to Function Parameters in SQL Server Transact-SQL? If you add a parame...