1 public string showtime()
2 {
3 DateTime now = DateTime.Now;
4 StringBuilder sb = new StringBuilder();
5 System.Threading.Thread currentThread = System.Threading.Thread.CurrentThread;
6 System.Globalization.CultureInfo cultureInfo =
(System.Globalization.CultureInfo)currentThread.CurrentCulture.Clone();
7 sb.AppendFormat("{0}年{1}月{2}日 {3} {4}:{5}",
8 now.Year, now.Month, now.Day, "星期" + cultureInfo.DateTimeFormat.GetAbbreviatedDayName(now.DayOfWeek), now.Hour, now.Minute);
9 return sb.ToString();
10 }
2 {
3 DateTime now = DateTime.Now;
4 StringBuilder sb = new StringBuilder();
5 System.Threading.Thread currentThread = System.Threading.Thread.CurrentThread;
6 System.Globalization.CultureInfo cultureInfo =
(System.Globalization.CultureInfo)currentThread.CurrentCulture.Clone();
7 sb.AppendFormat("{0}年{1}月{2}日 {3} {4}:{5}",
8 now.Year, now.Month, now.Day, "星期" + cultureInfo.DateTimeFormat.GetAbbreviatedDayName(now.DayOfWeek), now.Hour, now.Minute);
9 return sb.ToString();
10 }