CDAT function - can it handle dd/mm/yyyy dates?

Hi. We recently upgraded our application server from 5.0.8 to 6.0.2 - and ‘strange’ things have happened to some of our agents with regards to Dates.

I’ve tried a very simple test on my local server (still 5.0.8), and the following code works perfectly well:

Dim testDate As New notesdateTime(“20/01/2003”)

Msgbox Cstr(testDate.Dateonly)

Msgbox " cdat testDate = " + Cstr(Cdat(Cstr(testDate.Dateonly)))

but when I try exactly the same lines of code in 6.0.2, I don’t get the second line in the log, just a type mismatch.

If anyone could give me an idea why it may be doing it I’d be very grateful (or even if someone could try it themselves and let me know the result!)

Thanks,

Tony

Subject: CDAT is not the problem

The problem is with the format of the date for notesdateTime. Check the Designer 5 Help documentation for NotesDateTime class and you’ll see that the permitted date parameter formats do not include DD/MM/YYYY.

Subject: RE: CDAT is not the problem

That makes me really cross. You don’t know what you’re talking about. NotesDateTime “New” method supports and has always supported dates with the day, month and year in the order called for by the operating system settings. The problem is apparently that the server’s settings are now set for mm/dd/yyyy format, not what they were expecting.

It’s bad practice in general to hardcode date/time values as strings for precisely this reason. Use Datenumber function.