so i have this problem, i want to make specific number to become a day of month.
example: i had an output of label
dim testing as string = ""
testing = Now.Year.ToString & Right("0" & Now.Month.ToString, 2) & Right("0" & "5" 2)
DateTime has a constructor that takes the year, month and day of month as parameters that you can use to create an instance:
Dim dayOfMonth As String = "5" Dim myDate = New Date(Date.Now.Year, Date.Now.Month, CInt(dayOfMonth))
You can use the
ToString method to format the date however you need:
Dim format1 As String = myDate.ToString("yyyy-MM-dd") Dim format2 As String = myDate.ToString("dd-MM-yyyy")