Not using code, no error messages. Using phpmyadmin to execute your query. Its returning NULL for all rows in the table. I know the problem and can not find a mysql function to fix it. date_format takes in a real date, while im storing the number of seconds (taken from time(), as said in my original post).