add a field of type TIMESTAMP to your table. When a new guestbook record is inserted, it will automatically get stamped without you having to add any more code to the SQL insert. PLEASE NOTE that subsequent UPDATES to these records will also put the current date in that field (unless you explicitly set it to itself: 'UPDATE table SET [...], createdon = createdon...')
Now, simply query it using the mysql function UNIX_TIMESTAMP(). An example:
'SELECT *, UNIX_TIMESTAMP(createdon) FROM table...' you can now use that value to apply php date() to.