I'm having trouble with getting a timestamp difference.
I have a Table with a timestamp (Type is datetime). I want my query to output the difference from current time - timestamp.
I've tried various queries using the timediff() class. But for some odd reason I get a difference that is 8 or so hours in the future.
My Table setup is as follows
Table A
*--------------------------------*
| PK | Item | TimeStamp |
| 1 | Apple| 2016-09-15 03:21:59|
*--------------------------------*
I would like the difference to output as such:
Output Table
*--------------------------------*
| Item | TimeStamp |
| Apple| 0Days 18Hrs 45Min |
*--------------------------------*
I've referenced a few other questions but didn't seem to work for me.
Like these:
Converting epoch number to human readable date in mysql
Is timestampdiff() in MySQL equivalent to datediff() in SQL Server?
I'm trying to get this result currently with a function and set both times up as variables.