How to convert a Date to a formatted string in VB.net?

后端 未结 5 461
感情败类
感情败类 2020-12-17 09:13

There seems to be a million questions here on converting a string to a Date, but not vice-versa. When I convert a Date object to a string using mydate.toString

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-17 10:06

    Dim timeFormat As String = "yyyy-MM-dd HH:mm:ss"
    objBL.date = Convert.ToDateTime(txtDate.Value).ToString(timeFormat)
    

提交回复
热议问题