If I set a date to any date with the time of 12:xx:xx AM/PM (where xx could be any number), the date time value shows correctly on the document and when viewing the variable it also shows the correct date and time.
However, in LotusScript it shows no time at all or a date/time in 1899.
I have tried to get the date value by:
x=doc.startdatetime(0)
x=doc.getfirstitem(“startdatetime”)(0)
set item=doc.getfirstitem(“startdatetime”)
set ndt=item.datetimevalue
all of them show the same value…
If I change the hour to ANYTHING other than 12 it works fine…
This is reproduced on server 8.1 and 7.3
help!!!
Subject: You haven’t shown how you display the date/time value
As a test, I tried this in 8.0.2:
Dim wksp As New NotesUIWorkspace
Dim doc As NotesDocument
Dim ndt As New NotesDateTime("12:09:45 AM")
Set doc = wksp.CurrentDocument.Document
doc.ReplaceItemValue "DateFoobar", ndt
t = doc.DateFoobar(0)
Print ":" & t & ":"
It prints :12:09:45 AM:
Does this code work the same for you? What do you mean that LotusScript “shows no time at all or a date/time in 1899”? None of the sample code you show, contains any statements that generate output.
Note also that the NotesDateTime object has properties to generate text output. Might you use them instead of whatever you’re doing? Date/time variants are in fact pretty useless.