我想要的是类似于这个的东西:
select to_time( to_timestamp ( '03.04.2014 12:34:00', 'DD.MM.YYYY HH24:MI:SS' ) )
问题在于 to_time 函数不存在。我希望结果为:
12:34:00 (without the date)
这可能吗?
select timestamp '2014-04-03 12:34:00'
。而这个是select time '2014-04-03 12:34:00'
。 - Clodoaldo Netoselect pg_typeof(time '2014-04-03 12:34:00');
- Clodoaldo Netotimestamp '2014-04-03 12:34:00'
是一个ANSI时间戳字面量,而不是转换。我很惊讶time '2014-04-03 12:34:00'
可以工作,因为那应该是一个非法的时间字面量。 - user330315time '2014-04-03 12:34:00'
能够正常工作是因为 PostgreSQL 在处理日期/时间输入方面比 SQL 标准要求更加灵活。http://www.postgresql.org/docs/9.3/static/datatype-datetime.html - pozs