> In my MySQL table I have a number of records with their date field generated by the PHP time() function, > which produces an integer like 1006114779. This is great to format into a date and time string with PHP, > but how can I sort these records by a part of the date (e.g by month or year) ? Mysql docs rule. See http://www.mysql.com/doc/D/a/Date_and_time_functions.html for info on extracting days months, etc. from timestamps using built-in functions. -martin