Dim tingin As Date = DateAndTime.DateAdd(DateInterval.Day, -1, DateAndTime.Now)
Dim trimmoto As String = Trim(tingin)
MsgBox(trimmoto)
I want to get the 'DATE ONLY'
CodePudding user response:
Add :-
Dim tingin As Date = DateAndTime.DateAdd(DateInterval.Day, -1, DateAndTime.Now)
Dim trimmoto As String = tingin.ToString("yyyy/MM/dd")
MsgBox(trimmoto)
Or :-
Dim tingin As Date = Now.AddDays(-1)
Dim trimmoto As String = tingin.ToString("yyyy/MM/dd")
MsgBox(trimmoto)