asp.net datetime dayofweek property - how to get short date format

I have code behind of datetime that displays the day of week

time.StartDate.DayOfWeek

I need to amend the code so it displays   Mon as oppose to Monday
mugseyAsked:
Who is Participating?
 
Naithan ArroyoCommented:
mid(time.StartDate.DayOfWeek,1,3)

you can do somthing like this
0
 
mugseyAuthor Commented:
OK thanks

I am using c# so I need a tostring() method that just gets the first three characters
0
 
DanMerkCommented:
if you set it equal to a string, then you can use substring to format it like so:

string s = DateTime.Today.DayOfWeek.ToString();
s = s.Substring(0,2)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.