IBM has provided the following code to adjust date/time fields that fall into the new DST time period:
Dim doc As NotesDocument
Dim vArray () As Variant
Dim startDateTime1 As New NotesDateTime (“3/11/2007 2:00:00 AM”)
Dim endDateTime1 As New NotesDateTime(“4/1/2007 2:00:00 AM”)
Dim startDateTime2 As New NotesDateTime (“10/28/2007 2:00:00 AM”)
Dim endDateTime2 As New NotesDateTime(“11/4/2007 2:00:00 AM”)
…
Forall i In doc.items 'Check all items in document
If i.type=1024 Then 'Only act on items of Type DateTimes (1024)
Redim vArray (Ubound(i.Values))
For j = 0 To Ubound (i.Values) 'Loop in case of multiple values
Set datetime = New NotesDateTime (Cstr(i.Values(j)))
If datetime.timezone<>0 Then 'Do not act on Time only fields
If ((datetime.LSLocalTime >= startDateTime1.LSLocalTime) And _
(datetime.LSLocalTime < endDateTime1.LSLocalTime)) Or _
((datetime.LSLocalTime >= startDateTime2.LSLocalTime) And _
(datetime.LSLocalTime < endDateTime2.LSLocalTime)) Then
datetime.AdjustHour (-1)
End If
vArray(j) = datetime.LSLocalTime 'Reset array value
End If
Next
i.Values = vArray 'Store array into the item
End If
End Forall
Call doc.Save(True, True)
The problem is, it does nothing to determine if the time zone is ALREADY correct. It is possible that there will be some documents that were saved from a PC with the OS patch (and therefore don’t NEED to be updated), and other saved from a non-patched machine that really need to be fixed. Unless I’m missing something, this will result in any documents saved post-patch to be an hour off for that time frame.
Does anyone know of a solution to change only the documents that need updated?