标签:parse ring add 时间 code rgs tostring main style
class Program { static void Main(String[] args) { DateTime currentTime = System.DateTime.Now; string defaultYear = currentTime.Year.ToString("d4"); string defaultMonth = currentTime.Month.ToString("d2");//例:“06” //string defaultDay = currentTime.Day.ToString("d2"); //string defaultHour = currentTime.Hour.ToString("d2"); string defaultDay = currentTime.AddHours(-24).Day.ToString("d2"); string dateString1 = defaultYear + defaultMonth + defaultDay + "08"; DateTime dt1 = DateTime.ParseExact(dateString1,"yyyyMMddHH",System.Globalization.CultureInfo.CurrentCulture); dateTimePicker1.Value = dt1; } }
标签:parse ring add 时间 code rgs tostring main style
原文地址:https://www.cnblogs.com/PanDaSong/p/9246373.html