I have been trying to write a MySQL query recently in which I subtract the current system timestamp from a timestamp stored in a column in one of my MySQL tables.
Here is the query I used:
SELECT ID_MEMBER, date, UNIX_TIMESTAMP( ) AS now, date - UNIX_TIMESTAMP( ) AS timeleft
FROM items AS a
WHERE ID_ITEM =1
Here is the output I got after running the above query in phpmyadmin:
So why does it give:
1266017133 - 1277569539 = 18446744073697999210 ?
Note: I only get this problem when the answer is a negative value, as with the above example.
Question
Tafalezono
I have been trying to write a MySQL query recently in which I subtract the current system timestamp from a timestamp stored in a column in one of my MySQL tables.
Here is the query I used:
Here is the output I got after running the above query in phpmyadmin:
So why does it give:
1266017133 - 1277569539 = 18446744073697999210 ?
Note: I only get this problem when the answer is a negative value, as with the above example.
Link to comment
Share on other sites
7 answers to this question
Recommended Posts