Cdat only works with US Dates

I have code which works fine on 3 servers however one server will generate an error if the cdat function gets a date in European format.

The date on the server is European format.

What is going on here is cdat affectec by some server setting.

Subject: Cdat only works with US Dates

No you are right. CDat() does seem to work with American format dates even when the server is configured with a different format. The exception is when the US format is invalid. It then tries to be clever and try European format. For example, 30/1/2007 would convert to 30th Jan but 12/1/2007 would convert to 1st December!

If possible, don’t hold the date in a string format at all.

Subject: Cdat only works with US Dates

I believe cdat will use the regional settings on the box it’s running on to convert the date.

My personal preference is yyyy-mm-dd, so if the system gets a string in the format “mm/dd/yyyy”, cdat gives me a type mismatch error.