bitt3n
asked on
Why does TIME_TO_SEC not convert time to seconds in the following statement?
What is the proper SQL syntax for getting the difference between two dates, and returning the result in seconds?
Specifically I am confused why the following syntax
SELECT TIME_TO_SEC( DATEDIFF( NOW( ) , SUBDATE( NOW( ) , INTERVAL 1 DAY ) ) )
returns 1, when that is the number of days and not the number of seconds in the date difference.
Specifically I am confused why the following syntax
SELECT TIME_TO_SEC( DATEDIFF( NOW( ) , SUBDATE( NOW( ) , INTERVAL 1 DAY ) ) )
returns 1, when that is the number of days and not the number of seconds in the date difference.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER