LMSouq
database Open

Calculate difference between two datetimes in MySQL

DE
Devesh Agrawal
1 month ago
3 views
Problem Description
I am storing the last login time in MySQL in, `datetime`-type filed. When users logs in, I want to get the difference between the last login time and the current time (which I get using `NOW()`). How can I calculate it?

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base