tags:

views:

21

answers:

2

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?

+1  A: 

Try the document "GetItemValueDateTimeArray" method instead of "GetItemValue"

Carlos
+1  A: 

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:

...
Document docJournal = ...
DateTime DiaryDate = docJournal.getCreated().getLocalTime();
...
Ed Schembor