I did this in php to store the lastlogin in a mysql datetime column
date(\'Y-m-d h:i:s\') //which then gave > \'2014-01-04 08:00:56\'
and th
I don't think that this would be a timezone issue because PHP and MySQL both are running on same machine so both would be getting same time on calling current datetime. May be you can try this because I tried this on my machine as you said.
SELECT * FROM `elc_users` WHERE lastlogin < date_add(NOW(), INTERVAL -20 MINUTE)