The example in this article describes how the C # Simple implementation shows the day of the week in Chinese format. Share to everyone for your reference, specific as follows:
1.
Copy Code code as follows:
DateTime.Now.ToString ("dddd", New System.Globalization.CultureInfo ("ZH-CN"));
2.
Copy Code code as follows:
New string[] {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday",}[convert.toint16 (DateTime.Now.DayOfWeek.ToString ("D"))] ;
3.
"Week" +datetime.now.dayofweek.tostring (("D"))
4.
<summary>
///return date
///</summary>
///<returns></returns>
Public static string DayOfWeek
{
get
{
switch (DateTime.Now.DayOfWeek.ToString ("D"))
{case
"0": return
"Sunday";
Case "1": Return
"Monday";
Case "2": Return
"Tuesday";
Case "3": Return
"Wednesday";
Case "4": Return
"Thursday";
Case "5": Return
"Friday";
Case "6": Return
"Saturday";}}
Read more about C # Interested readers can view the site topics: "C # form Operation Tips Summary", "C # Common control usage Tutorial", "WinForm Control Usage Summary", "C # Programming Thread Usage Skills summary", "C # Operation Excel Skills Summary", "C # Summary of operational skills in XML files, C # tutorial on data structure and algorithms, C # array operation techniques Summary, and C # Introduction to object-oriented Programming
I hope this article will help you with C # programming.