[thelist] php/mysql - sort records by month?

Martin Kuplens-Ewart martin at takingitglobal.org
Fri Feb 22 06:32:00 CST 2002


> 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





More information about the thelist mailing list