将yyyyMMdd格式的字符串转成日期DateTime格式

1、DateTime dt= DateTime.ParseExact("20110720", "yyyyMMdd", Thread.CurrentThread.CurrentCulture);

2、日期插入MDB中

例如MDB中某字段是日期格式的。则需要用到下边的方法。

format('" + dtpDCRQ.Value.Date + "','yyyy/mm/dd')

insert Table (TimeA) values (format('" + dtpDCRQ.Value.Date + "','yyyy/mm/dd'))

原文地址:https://www.cnblogs.com/joysky/p/3965078.html