You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
因为目前对pg不支持
DateTimeOffset
,所以只能用DateTime
,默认情况下会生成timestamp
,保存时间时会丢失时区信息。用以下设置可以使DateTime携带时区信息:
实体类型用
DateTime
,指定DbType为timestamptz
,这样存到数据库是带时区的,读回来的DateTime对象的Kind是Local,这样就是全部正确的。如果不设置DbType,默认DateTime映射到timestamp,那么存数据库没有时区信息,读回来的Kind就是Unspecified的。
例子:
Beta Was this translation helpful? Give feedback.
All reactions