显示日期+星期+时间的实现代码

public string ShowTime()
{
 string s;
 s = DateTime.Now.ToString("D");
 string[] x = new string[7] ...{ "日", "一", "二", "三", "四", "五", "六" };
  int n;
  n = int.Parse(DateTime.Now.DayOfWeek.ToString("D"));
  s += "  星期" + x[n] + "  " + string.Format("{0:t}", DateTime.Now);
  return s;
}

你可能感兴趣的:(java)