数据库是datetimeoffset(7),C#是DateTimeOffset类型,查询的时候需要注意时区,

比如

那是select * from table where data>='2021-07-02'则不会出现数据库的值是2021-07-02 00:00:00.0000000 +08:00的信息,需要带入完整时区信息

select * from table where data>='2021-07-02 00:00:00.0000000 +08:00',DateTimeOffset如果传递的是string,则需要格式化,使用ToString("yyyy-MM-dd 00:00:00.0000000 zzz")或者ToString("yyyy-MM-dd HH:mm:ss.fffffff zzz")}

相关文章:

  • 2022-12-23
  • 2021-06-28
  • 2022-12-23
  • 2021-08-29
  • 2022-02-27
  • 2021-09-20
  • 2021-12-18
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-24
  • 2021-08-30
  • 2021-06-02
  • 2022-12-23
相关资源
相似解决方案