Link to home
Start Free TrialLog in
Avatar of VBdotnet2005
VBdotnet2005Flag for United States of America

asked on

timespan

dim mytime as timespan
dim myfile as fileinfo
dim mydir as new directoryinfo(mypath)

mytime = datetime.now - myfile.creationtime   < eror "operator is no defined "-"
ASKER CERTIFIED SOLUTION
Avatar of VBRocks
VBRocks
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Also, you might want to set myFile to mypath, if mypath stores the path of a file:

        Dim mytime As TimeSpan
        Dim myfile As New FileInfo(mypath)

        mytime = datetime.Now.Subtract(myfile.creationtime)

        MsgBox(mytime.TotalDays)