Android Question DateUtils help

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
Before someone tells, yes I search the forum and did not realized how to do ii.

I need to substract 60 day to now, how to do it?

NewDate = Now - 60

Thanks
 

DonManfred

Expert
Licensed User
Longtime User
B4X:
    Dim heute As Long = DateTime.Now
    Dim p As Period
    p.Days = -60
    Log(DateTime.Date(DateUtils.AddPeriod(heute,p)))
 
Upvote 0

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
THis neither
B4X:
            DateTime.DateFormat="yyyy-mm-dd"
            Dim hoy As Long = DateTime.Now
            Dim p As Period
            p.Days = -60
            DateTime.Date(DateUtils.AddPeriod(hoy,p))
Results in '2015-10-18'
 
Upvote 0
Top