datetime mess help??

tinomesa

Member
Joined
Jul 14, 2003
Messages
13
Location
Maryland
Hello,



I need to get todays date (-365) in a shortdate type string, so that I can delete records older that a year (or so) from a DB.

I tried
Dim myyear As String = CStr(Today.Month) + "/" + CStr(Today.Day) + "/" + CStr(Today.Year - 1)
Dim targetdate As Date = CDate(myyear).ToShortDateString()

But it seems costly, is there any other built function to do this?



Thanks:)
 
Last edited by a moderator:
Back
Top