Reading a Date/Time field

I have a date/time field on a form and in the document properties of the document it shows the value as ‘05/12/2009 02:29:26 PM ZE5B’.In a function I am trying to read the vlaue in NotesDateTime format this way.

Dim item As NotesItem

Dim startTime as NotesDateTime

Set item = doc.GetFirstItem(“Datesent”)

Set startTime = item1.DateTimeValue

I am not getting any value in startTime. I need startTime as NotesDateTime format only. Can someone please help me out.

Thanks a lot.

Subject: Reading a Date/Time field

Perhaps this is a typo in your post, but in this line

Set item = doc.GetFirstItem(“Datesent”)

You set item to the value of the Datesent field

but then here you reference item1, not item

Set startTime = item1.DateTimeValue

Subject: RE: Reading a Date/Time field

Which would mean the real problem is failure to use Option Declare

Subject: Reading a Date/Time field

You need to instantiate the NotesDateTime object

Dim startTime as NotesDateTime

Set startTime=New NotesDateTime(doc.DateSent(0))