下列程式可算出以今天為準的話,7天前是星期幾

 

DateTime PastDate=new DateTime();

 

PastDate = DateTime.Now;

 

TimeSpan ts = new TimeSpan(7,0,0,0);

 

PastDate = PastDate.Subtract(ts);

 

PastDate.ToShortDateString();

 


welkingunther 發表在 痞客邦 PIXNET 留言(0) 人氣()