C# 获得固定年月日
标签:oda style span div date 年月日 turn short col
///
/// 获得固定年月日,时和分不固定 : 2019-01-01 00:00:00
///
///
public DateTime GetFixedDateTime(string Hour = "", string Minute = "")
{
string time1 = DateTime.Now.ToShortTimeString(); //16:50
//yyyy-MM-dd hh:mm:ss //2019-01-01 16:34:00
string Ymd = "2019-01-01 ";
if (Hour=="")
{
Hour = DateTime.Now.Hour.ToString();
Minute = DateTime.Now.Minute.ToString();
}
return Convert.ToDateTime(Ymd + Hour + ":" + Minute + ":" + 00);
}
C# 获得固定年月日
标签:oda style span div date 年月日 turn short col
原文地址:https://www.cnblogs.com/enych/p/10329451.html
评论