By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,990 Members | 2,324 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,990 IT Pros & Developers. It's quick & easy.

Invalid Date does not throw an exception

P: n/a
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.
Mar 23 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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" <ga***@discussions.microsoft.com> schreef in bericht
news:5D**********************************@microsof t.com...
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.

Mar 23 '06 #2

P: n/a
"gavin" <ga***@discussions.microsoft.com> schrieb:
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'?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Mar 23 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.