我有一个vb.net数据表 数据是由用户输入,因此没有涉及SQL表。datatable短日期格式
当我存储的“2016年2月1日”到数据表和吐回来了,它显示为“2016年2月1日12:00:00 AM”
什么是最好的方式格式化这回 “2016年2月1日”
Dim table As New DataTable
table.Columns.Add("Date", GetType(DateTime))
table.Rows.Add("2/1/2016")
debug.print (table.rows(0)("Date").tostring)
感谢
一个DateTime总是有一个日期和时间。使用显示机制仅显示日期 – Plutonix
我尝试使用getType(日期),但我仍然得到“2/1/2016 12:00:00 AM” – BobNoobGuy
将*总是*是结构的时间元素。 'Debug.Print(Convert.ToDateTime(table.Rows(0)(“Date”))。ToShortDateString)' – Plutonix