I am new to C# and I have a simple need but I am unsure how to accomplish it.
I want to get the current day of the week. Ex. Monday, Tuesday, etc.
I use the following code to create a DateTime object but how do I set it to the current date and time?
Is this how I should go about getting the current date or is there a better way?
How do I properly use
?
Thanks for the help,
Gabe
I want to get the current day of the week. Ex. Monday, Tuesday, etc.
I use the following code to create a DateTime object but how do I set it to the current date and time?
Is this how I should go about getting the current date or is there a better way?
Code:
DateTime dateTime = new DateTime();
string currentDate = dateTime.ToString();
How do I properly use
Code:
DateTime.Now();
Thanks for the help,
Gabe