public string GetCheckDate() { var now = DateTime.Now; var year = now.Year; //年 var month = now.Month; //月 var day = now.Day; //日 var clock = year + "-"; if (month < 10) clock += "0"; clock += month + "-"; if (day < 10) clock += "0"; clock += day + ""; return (clock); }
时间: 2024-11-10 21:01:59