C#Winfrom数据库读取日期(年月日格式转换)

显示类型:2018-6-1

//说明:data_time.Text 控件名文本值 ;dataset.Tables[0].Rows[0]["art_time"]  数据集.表名.[行标][列标]

data_time.Text = Convert.ToDateTime(thisDS.Tables[0].Rows[0]["art_time"]).ToShortDateString();

显示类型:2018年6月1

data_time.Text = Convert.ToDateTime(thisDS.Tables[0].Rows[0]["art_time"]).ToLongDateString();

原文地址:https://www.cnblogs.com/hzpeng/p/9129576.html