It's a simple query to retrieve for users, how many minutes, or hours or days they were last online. The calculations for hours and days are correct. However for minutes, the following is returning correct value but negative e.g. -4 minutes, -6 minutes, -10 minutes when should be positive. It's a simple query to retrieve for users, how