i want to retrieve only the second field from system datetime..how can i do that??can anyone plz help me..thanks in advance
Welcome to @Daniweb.
I didn't get your question. Do you want to get Parts (Day, Month etc from DateTime?
DateTime date=DateTime.Now; Console.WriteLine(date.Day); Console.WriteLine(date.Month);
thanks for your reply...datetime gives time and date both..now my question is i just want to pick second field from that time
You can use
DateTime date=DateTime.Now; Console.WriteLine(date.ToString("d")); Console.WriteLine(date.ToString("t")); Console.WriteLine(date.ToString("hh:mm:ss tt")); Console.WriteLine(date.TimeOfDay.ToString());