Dim now As Date = Date.Now
Dim str As String = ""
str = now.ToShortDateString() '日期
str = now.ToShortTimeString() '时间
str = now.ToString("yy-MM-dd") '转换成指定格式
DateTime time=Convert.ToDate("年月日 时分秒");//"2011-5-16 12:54:35"
string shortTime=time.ToString("yyyy-M-d");
或者 string shortTime= time.ToShortDateString();( time.ToShortTimeString();)