how to get current day in windows phone?

2.7k Views Asked by At

I'm building an app which needs to function depending on the current day. I've googled but returned with no results. Is there any function in C# that will return the current day depending on system time? Any help would be appreciated.

3

There are 3 best solutions below

0
On BEST ANSWER
var dateTime = DateTime.Now.Day;

More info is found in the actual documentation from MSDN

1
On

Have you tried DateTime.Now.Day? Sorry but I can´t comment yet.

@edit

For more information about the DateTime class, take a look at this link: http://msdn.microsoft.com/en-us/library/system.datetime.aspx

2
On

This is what I use to display the date as: MM/DD/YYYY

string fullDate;
string date = DateTime.Today.Day.ToString();
string month = DateTime.Today.Month.ToString();
string year = DateTime.Today.Year.ToString();

fullDate = month + "/" + date + "/" + year;