一、PostgreSQL
1.字符日期格式转换为时间戳格式
select * from tablename where log_time>= extract(epoch from date('2015-10-09 00:00:00'));
2.unix时间戳转化为字符日期格式
select * from t20140702 where date(to_timestamp(log_time)) >='2014-07-02 16:00:00' ;
SELECT *,TIMESTAMP 'epoch' + log_time * INTERVAL '1 second' from t20140702
二、MySQL
1.字符日期格式转换为时间戳格式
SELECT UNIX_TIMESTAMP('2010-03-01 00:00:00')
2.unix时间戳转化为字符日期格式
SELECT FROM_UNIXTIME(1267372800)