postgresql有很多可用的日期时间函数:
在这里查看清单
http://www.postgresql.org/docs/9.1/static/functions-
datetime.html
例如
SELECt EXTRACT(DAY FROM TIMESTAMP '2001-02-16 20:38:40');Result: 16
要进行格式化,可以使用以下命令:
http://www.postgresql.org/docs/9.1/static/functions-
formatting.html
例如
select to_char(current_timestamp, 'YYYY-MM-DD HH24:MI') ...



