Dim doc as NotesDocument Dim newDate as NotesDateTime Dim dates () As NotesDateTime Dim numValues as Integer Dim i as Integer Set newDate = New NotesDateTime ( cstr ( doc.StartDate (0) ) ) Call newDate.SetAnyTime numValues = 5 '-- or some other calculated value Redim Preserve dates ( numValues - 1 ) For i = 0 To ( ubound ( dates ) ) Set dates (i) = New NotesDateTime ( newDate.DateOnly ) Call dates (i).SetAnyTime '-- this is key to getting rid of the midnight time newDate.AdjustDay (1) Next Call doc.ReplaceItemValue ( "StartDates", dates )
1. Eric Rehnke05/10/2006 06:49:19 PM
You can't imagine how much time we have spent trying to make this work from the back-end classes. This solution is so elegant and works perfectly! I want to thank you for your effort here!!! The Notes documentation on .SetAnyTime suck as is typical for Notes documentation.
This is GREAT!!!! Lot's of others have been trying to achieve this as witnessed by the amount of traffic on the Notes forums.
Thanks again!!!
2. Randy01/04/2007 01:53:42 PM
Thank you!!
I have been struggling with dates continually getting changed to string format after I manipulated them in LS. Using the code above as an example I was finally able to get my dates to stay as a date/time format. The only hint in the documentation regarding SetAnyTime was that once done, field cannont be converted to text.
3. Manu Vermeyen06/18/2009 09:34:55 AM
Yup, a lifesaver! thank you very much. I looked for this solution for a while!
Su | Mo | Tu | We | Th | Fr | Sa |
|---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | |||