View Single Post
  #1 (permalink)  
Old April 5th, 2012, 11:21 AM
ltimms ltimms is offline
Registered User
Points: 13, Level: 1
Points: 13, Level: 1 Points: 13, Level: 1 Points: 13, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Cool String was not recognized as a valid DateTime

The folllowing line of code gives the error: String was not recognized as a valid DateTime. This happens at runtime, everything compiles with no problem.
I tried substuting DateTime.Now and got the same error. I also tried the commented out solution below, all trials gave the same error. At this point I'm out of ideas.

P.S. This is from Chapter 9, the Movie class setup. I commented out all the code to focus on getting the first Movie added and have had no luck up to this point.

System.DateTime str_date = DateTime.Parse("15/6/2001");

//System.Globalization.CultureInfo.CreateSpecificCul ture("en_AU").DateTimeFormat);

Last edited by ltimms; April 5th, 2012 at 11:27 AM. Reason: To add the chapter I am having the problem with