Datetime Exception

  • Thread starter Thread starter news.microsoft.com
  • Start date Start date
N

news.microsoft.com

dim d as datetime
d = DateTime.Parse(#6/10/2004 11:50:40 PM#) produces exception "String was
not recognized as a valid DateTime."
d = DateTime.Parse("6/10/2004 11:50:40 PM") is OK
d = DateTime.Parse(#6/10/2004 11:50:40 AM#) is OK
can somebody expain what is wrong with the first statement
I am using VS 2003 with framework version 1.1 sp1
Thanx George
 
news.microsoft.com said:
dim d as datetime
d = DateTime.Parse(#6/10/2004 11:50:40 PM#) produces exception "String was
not recognized as a valid DateTime."

Why do you use 'DateTime.Parse' in this case at all? It's not necessary...
 
I downloaded Traker sample application from Infragistics and when I tryed to
execute it I received this error.
I know this is not necessary but the error is weird. Dont you think so too?
Is there somethink wrong with the code becaurse I dont see anything wrong
with the datetime value.
George
 
Hello,

Why not make it yourself easy with an always in all regions all languages
all cultures working code
d = DateTime.Parse(#6/10/2004 11:50:40 PM#) produces exception "String was

d = new Date(2004,6,10,11,50,40)

Cor
 

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