2
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by pmondal47
0

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);
0

hi,
thanks for your reply...datetime gives time and date both..now my question is i just want to pick second field from that time

0

You can use date.Date or date.ToString(format) method.

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());

Edited by __avd

0

HI,
can anyone pls help me regarding the following context..suppose i hv 3 form in javascript..when user give valid info in the first form then only the 2nd one will enable..after validation of 2nd one the 3rd one will enable ..not only that say 1st form has a title when i click on that title the form will enable ..and when i click on the title again the form will disable ..how it can be done???any hints..( ya 1 more thing without using any library i have to perform the task..)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.