Problem Setting Notes Date Time Object

Hi All,

I am facing a problem setting NotesDateTime object. I am setting NotesDateTime object like below:

set dateObj = New NotesDateTime(DateNumber(vYear%, vMon%, vDay%))

I am getting variables(vYear%, vMon%, vDay%) from as user inputs in ‘ddmmyy’ format in a text field. I extract the string in respective variables. But issue arise when user enter ‘151048’ pls note here user want ‘48’ as ‘1948’, but acc to DateNumber function if you enter from 00 to 49 it takes it as 2000 and 2049, if you enter 50 to 99 it takes it as 1950 to 1999.

Is there any way to cope up this problem. Pls let me know. Thanx in advance.

Warm Regards,

Gurcharan Saini,

saini.gurcharan@gmail.com.

Subject: Problem Setting Notes Date Time Object.

The reason it does this is because of the Date/Time settings in the XP Operating system under Control Panel → Regional Settings. This tells the computer wether 2 digit years should be counted as part of this centuary or the last one.

Since you don’t want to change the OS setting, I would either use a date-time field and set the always use 4 digit year setting or specify that your users must type in the text date in ddmmyyyy format. If you don’t do this you will have to write your own code logic to work out which centuary the year should be in and supply that to your NotesDateTime object.

Subject: Problem Setting Notes Date Time Object.

I think you can only overcome this by getting a 4 digit year, otherwise Notes is going to guess wrong.

From Designer Help …

Entering two-digit years between 50 and 99 assumes the century starting in the year 1900. If you want users to enter a four-digit year in the field, on the Control tab of the Field Properties box, select On input “Require user to enter four digit years.”