2013-11-24 62 views
0

Postgres的CHAR(14)字段存儲日期時間withou像分離20131124112907如何YYYYMMDDHHMMSS轉換爲2013年11月24日11時29分07秒在Postgres的

如何添加分隔符,這樣的結果是字符串格式

2013年11月24日11時29分07秒

我嘗試使用

to_timestamp(timestamp, 'YYYYMMDDHHMISS')::text as updated_at 

丹尼斯的答案,但有例外

Message=ERROR: 22007: hour "15" is invalid for the 12-hour clock 
    Code=22007 

    File=src\backend\utils\adt\formatting.c 
    Hint=Use the 24-hour clock, or give an hour between 1 and 12. 
+0

你做在SQL服務器這種轉換? –

+0

我的服務器是PostgreSql – Andrus

回答

相關問題