Setting the value of a Date field using Lotus Script

Hi,

Is it possible to set the value of a Date/Time field to a date only, using ReplaceItemValue? I have tried various things but a default time of 00:00 GMT is always stored. This causes problems as the field is used to add meeting entries to the Notes calendar. In certain countries this causes the meeting to be a day behind what it should.

The hopefully temporary solution is to run a scheduled agent to update the field using formula language, which does add a date only without time.

The field is set to display dates only, but presumably that doesn’t apply to storing. The value I am using for setting is being retrieved from another field using GetItemValue if that makes any difference.

Thanks,

Subject: Use a NotesDateTime object

It sounds like you are using a LotusScript date field. That’s really just a real number, with the integer part being the date, and the decimal part being the time. Because of this, you can’t have a “date only” value.

Instead, use a NotesDateTime object, and use the SetAnyTime method.

Subject: when stored, there is no such a thing like a date only field.

There is multiple problems caused by this.

Getting to the area you are talking about, you might want to actually use the time part to get around your problem - e.g. by setting the meeting date to Day X on 3 am or something.

There is ways to do timezones too, but with multiple timezones I guess the above is what you are looking for. Depending on the setup, when daylight saving time changes, this can influence your date, too (various things, Server, Client, OS of Server, OS of client, and if a traveling user changes windows time instead of windows timezone, you might be entirely out of luck, anyhow).

Subject: s

Right, some things to consider. Thanks for your responses.