Datatime.Now(); //當前時間
DateTime sy = new DateTime();//sy為datetime型sy = System.DateTime.Today;//取當前日期給systring year = sy.Year.ToString();//取年份string month = sy.Month.ToString();//取月份string day = sy.Day.ToString();//取日