Invalid Date does not throw an exception

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Have a Windows for with a textbox.
Enter a date 2006/1/1/ -Note an additinal / on th end

This is clearly an error but when text is cast to a date the extra / is
automatically removed. The cast date displays as #1/1/2006#.

Is this correct?

Much appreciated.
 
Gavin,

The behaviour of the datetime in strings is completely dependend from the
standards in your culture or the setting of that in the station. Therefore
an almost impossible to answer question for somebody outside your culture.
Be aware that Canada has by instance 2 cultures.

It does not help, however gives maybe an idea.

Cor
 
gavin said:
Have a Windows for with a textbox.
Enter a date 2006/1/1/ -Note an additinal / on th end

This is clearly an error but when text is cast to a date the extra / is
automatically removed. The cast date displays as #1/1/2006#.

Which method are you using to convert the string to a date? 'CDate'?
 
Back
Top