VB.net: Date without time

后端 未结 5 1490
日久生厌
日久生厌 2020-12-15 05:54

How do you format the date time to just date?

For example, this is what I retrieved from the database: 12/31/2008 12:00:00 AM, but I just want to show the date and

5条回答
  •  猫巷女王i
    2020-12-15 06:34

    Format datetime to short date string and convert back to date

    CDate(YourDate.ToString("d"))
    

    Or use short date string

    CDate(YourDate.ToShortDateString)
    

提交回复
热议问题