在 NHibernate NamedQuery 中,如何使用 DateTimeOffset 作为参数

发布于 2024-10-09 06:59:18 字数 235 浏览 0 评论 0原文

当我在 NHibernate 中运行 NamedQuery 时,如果我使用 SetParameter("name", date) 或 SetParameter("name", date, new DateTimeOffsetType()) 设置 DateTimeOffset,则会在发送查询时丢失时间偏移信息 ('2011 -01-01T14:00:00.00')。

有谁知道我在哪里/如何告诉 NHibernate 使用完整的日期字符串?

When I run a NamedQuery in NHibernate, if I set a DateTimeOffset using SetParameter("name", date) or SetParameter("name", date, new DateTimeOffsetType()), it loses the time offset information when sending the query ('2011-01-01T14:00:00.00').

Does anyone know where/how I can tell NHibernate to use the full date string?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

病女 2024-10-16 06:59:18

抱歉,我的查询出现了另一个问题。日期时间字符串输出仅在 NHProfiler 中。使用常规查询日志记录表明它正在发送正确的时间偏移信息。

Sorry, there was another problem going on with my query. The date time string output was just in NHProfiler. Using regular query logging showed that it is sending the correct time offset information.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文