Hi there,

i wanna diplay some revisions of nodes in a drupal table but i cant work out how to
extract the date out of the timestamp field in the sql query.
I tried db_query("SELECT DATE_FORMAT(timestamp, '%d %M %Y') FROM ...);
but it didnt return anything...

Is there a way to convert the timestamp back to a date with sql or do i have to get the timestamp and convert it later
with php?

Thanks in advance,
Castell

Comments

theabacus’s picture

You can convert the date with the drupal function format_date (http://api.drupal.org/api/function/format_date/6) or the PHP date function.

However, if you just want a table to list node revisions, why don't you use Views to do it (http://drupal.org/project/views)?

Castell’s picture

Views is a great module, but it takes too much mem load...as soon as this problem is solved, i´m on using views again :)

Thanks for your answer,
Castell