I have a date field and user inputs date from Calendar control. (Display date only).After save I must change date from script agent on some documents.
When user input date format is dd.mm.yyyy (8bytes) like 01.11.2006
But script changes this format to dd.mm.yyyy hh.mm.ss (12 bytes) like 01.11.2006 00:00:00
I need 8 byte Date/Time.
Data type should be Date/Time, not text.
I tried sevral code but I cannot get 8bytes date…
There is any solution ??
Below is my code.
ndate = Cdat(“November 01,2006”)
doc.replaceitemvalue “myDate”,Cdat(Format(ndate,“dd.mm.yyyy”))
or
doc.replaceitemvalue “myDate” ,Datevalue(“November 01,2006”)
Thanks
Subject: RE: I need 8byte date format
If you want to store a date without a time, you must use the NotesDateTime class – see SetAnyTime method, for instance.
Date/time variants in LotusScript don’t distinguish between midnight on a date, and date-only.
So in your case,
Dim ndat As NotesDateTime
Set ndat = new NotesDateTime(“November 01,2006”)
doc.replaceitemvalue “myDate”,ndat
Note also that since date/time values aren’t text, they are not stored in a particular format, e.g. with colons between the parts. That’s based on how you choose to display them.
Subject: RE: I need 8byte date format
Hello Andre
I had tried to use NotesDateTime class but I had beeing done mistake using DateOnly method.
Now I got required data by your code.
Thanks a lot !