获取“DateComlated”的空值和“时间组成”
我正在尝试使用 Domino.dll 读取 Notes 讨论数据库的“DateComlated”和“timeComlated”值。在阅读时,我得到了他们两个的“”。
示例代码:
DateTime DiaryDate = (DateTime)((object[])docJournal.GetItemValue("DateComposed"))[0];
DateTime dtTimeCreated = (DateTime)((object[])docJournal.GetItemValue("timeComposed"))[0];
还有其他方法来读取它们吗?
I am trying to read "DateComposed" and "timeComposed" values of Notes Discussion Database using Domino.dll. While reading I am getting "" for both of them.
Sample code:
DateTime DiaryDate = (DateTime)((object[])docJournal.GetItemValue("DateComposed"))[0];
DateTime dtTimeCreated = (DateTime)((object[])docJournal.GetItemValue("timeComposed"))[0];
Is there another way to read them?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试文档“GetItemValueDateTimeArray”方法而不是“GetItemValue”
Try the document "GetItemValueDateTimeArray" method instead of "GetItemValue"
实际上,DateComlated 和 TimeComlated 字段是“计算显示”字段,这意味着这些字段不是存储在文档中的实际字段,而是在通过表单呈现文档时动态计算的。在查看现成的注释讨论模板的表单设计时,我发现这两个字段是根据文档的内部创建日期计算的。那么,看一下 getCreated 方法,它返回一个 DateTime。然后您可以解析出日期和时间值。
尝试这样的事情:
Actually, the DateComposed and TimeComposed fields are "Computed for Display" fields, meaning these are not actual fields stored on the document, but are computed on the fly when a document is rendered through a form. In looking at the form design of the out-of-the-box Notes Discussion template, I see those two fields are computed based on the document's internal created date. So, take a look at the getCreated method, which returns a DateTime. You can then parse out the date and time values.
Try something like this: