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'?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top