Android Question DateUtils help

Discussion in 'Android Questions' started by Alberto Michelis, Jun 17, 2015.

  1. Alberto Michelis

    Alberto Michelis Active Member Licensed 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
     
  2. picenainformatica

    picenainformatica Active Member Licensed User

    Newdata=Now - 60 * TicksPerDay
     
  3. DonManfred

    DonManfred Expert Licensed User

    Code:
    Dim heute As Long = DateTime.Now
        
    Dim p As Period
        p.Days = -
    60
        
    Log(DateTime.Date(DateUtils.AddPeriod(heute,p)))
     
    mangojack likes this.
  4. Alberto Michelis

    Alberto Michelis Active Member Licensed User

    THis neither
    Code:
    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'
     
  5. Alberto Michelis

    Alberto Michelis Active Member Licensed User

    sory, my fault, its
    DateTime.DateFormat="yyyy-MM-dd"
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice