如下:
static List<string> weekCreate()
{
List<string> weekLi = new List<string>();
Random rand = new Random();
for (int i = -6; i <= 0; i++)
{
string hour = string.Format("{0:d2}",rand.Next(0, 23));
string miniute = string.Format("{0:d2}", rand.Next(0, 59));
string second = string.Format("{0:d2}", rand.Next(0, 59));
weekLi.Add(DateTime.Now.AddDays(i).ToString("yyyy-MM-dd") + " " + hour + ":" + miniute + ":" + second);
}
return weekLi;
}