Datareign

MySQL and Unix Timestamps

MySQL has some useful facilities for handling Unix style dates and times

Using the Unix Timestamp Function

You can create Unix epoch dates on the fly and you can compare them with 'real' dates…

select count(*)
  from watchdog
 where timestamp >= UNIX_TIMESTAMP('2009-11-01 00:00:00')
   and timestamp <= UNIX_TIMESTAMP('2009-11-31 23:59:59');
Last modified: 2009/12/07 09:21