I need to calculated difference in seconds between 2 dates. I cannot use TIMEDIFF because of its limitations.
When I use:
SELECT UNIX_TIMESTAMP('2015-03-28 08:21:15') - UNIX_TIMESTAMP('2015-03-27 08:21:15');
it returns expected 86400 seconds (what gives 24 hours) but when I use:
SELECT UNIX_TIMESTAMP('2015-03-29 08:21:15') - UNIX_TIMESTAMP('2015-03-27 08:21:15');
it seems it doesn't give 86400*2 but 169200 instead what gives 47 hours.
The question is - why is that? Is it a bug or feature? Is there any other reasonable way to calculate time difference not worrying about time limitations?