Pra*_*ase 4 c# asp.net-mvc asp.net-core litedb
插入时,偏移量正常,但是检索文档时,它会重置为 +00:00
财产:
public DateTimeOffset CreatedOn { get; set; }
Run Code Online (Sandbox Code Playgroud)
插入:
user.CreatedOn = DateTimeOffset.Now; // 01/20/2021 6:05:21 PM +05:30
col.Insert(user);
col.EnsureIndex(x => x.Username);
Run Code Online (Sandbox Code Playgroud)
寻找:
using (var db = _liteDbConnection.Create() as LiteDatabase)
{
var col = db.GetCollection<AuthUser>(USERS_COLLECTION);
return col.FindOne(x => x.UserId == userId);
}
Run Code Online (Sandbox Code Playgroud)
user.CreatedOn
变成
01/20/2021 6:05:21 PM +00:00
难道我做错了什么?
归档时间: |
|
查看次数: |
669 次 |
最近记录: |