I have a form that contains fields D_1, D_2, etc - all the way to D_14 to represent the dates in a 2 week period. These fields are computed as composed and are set when the document is created so they are not refreshed or based on a system date. Every 2 weeks an agent runs and creates one document for every employee. Everything works great. Problem…I have 1 user (it’s always someone) who’s document displays the wrong dates. This person is in the middle of the alphabet - so the people before and after him are fine.
The properties of the field are correct but it displays the wrong date. Example: Field D_1 says 5/19/08. But what you see is 5/18/08.
If I open the document on any other system it is fine. If I open this document with this person’s user id it’s fine. If we open the document on his citrix station or any other citrix station it displays the wrong date. No one else on Citrix has this problem. We have wiped their profile, and have recreated them in the system. It is still wrong. Does anyone have any ideas on what could be causing this or how to fix it?
Subject: This sounds like a time zone issue
Use the document properties infobox from a view to check the values of these fields. What you should see is, e.g. 07/31/2008. What you’ll actually see is something like 07/31/2008 12:00:00 AM CDT.
Your troublesome user is either in an earlier timezone, or has different daylight savings time settings, than your server. As a result, your 07/31/2008 12:00:00 AM CDT is his 07/30/2008 11:00:00 PM CDT. When you strip off the time and just display the date, it looks like it’s a day off; really it’s an hour off (or however many timezones distant they are). A date with no time is the same date for everyone. A date with a time depends where you are.
How did this happen? You assigned these date fields with LotusScript code such as:
doc.D_1 = Today
doc.D_2 = Today + 1
etcetera. The problem is that with a Lotusscript date/time variant, there is no such thing as a date with no time; midnight on the date means the same as just the date. But in Notes field values, we make a distinction. To store a date-only value, you must use a NotesDateTime object.
Dim ndt As New NotesDateTime(“”)
ndt.SetNow
ndt.SetAnyTime
for i = 1 to 14
doc.ReplaceItemValue “D_” & i, ndt
ndt.AdjustDay 1
next