【发布时间】:2013-10-25 18:26:57
【问题描述】:
在 Yesod 的模型中使用 UTCTime 字段时,我收到以下错误:
PersistMarshalError "field timestamp: Expected UTCTime, received PersistText \"09:18:07\""
我正在使用 SQLite 来存储我的数据库。我的模型如下所示:
Myobject
timestamp UTCTime default=CURRENT_TIME
otherfield Text
请注意,无论是否使用默认值,都会发生此错误。
我选择Myobject-entities 列表如下:
myobjects <- selectList [] [Desc MyobjectTimestamp]
使用MyobjectOtherfield 而不是MyobjectTimestamp 也无济于事,这是有道理的,因为所有数据都已获取并因此被封送。
here 有人问过类似的问题,但答案对我没有帮助。
在使用 SQLite 时如何在 Yesod 中使用UTCTime?
编辑:
错误中提到的PersistText \"09:18:07\" 是该字段默认的值。
【问题讨论】: