harish reddy

harish reddy

  • NA
  • 162
  • 33.1k

DateTimeClasss and Debug error

Apr 5 2018 9:08 PM
1. string first = "27/04/2010";
string second = "03/03/2006";
string format="dd/mm/yyyy";
DateTime firstparse = DateTime.ParseExact(first, format, CultureInfo.InvariantCulture);
Console.WriteLine("{0} {1} {2} ",firstparse.Day,firstparse.Month,firstparse.Year);
DateTime secondparse = DateTime.ParseExact(second, format, CultureInfo.InvariantCulture);
Console.WriteLine("{0} {1} {2} ", secondparse.Day, secondparse.Month, secondparse.Year);
 
Output is coming as 27 1 2010 and 03 1 2006. But i guess it should come as 27 4 2010 and 03 3 2006.
pls Let me know  why?
 
2. Also i get a frequent error message while debugging as "Unable to copy file obj\Debug\App.Client.exe to bin\Debug\App.Client.exe. The process cannot access the file 'bin\Debug\App.Client.exe' because it is being used by another process. ". Slide attached. Let me know why pls?

Attachment: Presentation1.zip

Answers (2)