Hello
See this first example :
It returns me 28 days. OK
The problem
It returns me 1 month.
The right was not 29 days. Why a month?
See this first example :
B4X:
DateTime.dateFormat = "dd/MM/yyyy"
Dim periodo As Period
periodo = DateUtils.PeriodBetween(DateTime.DateParse("31/01/2016"),DateTime.DateParse("28/02/2016"))
Log("Year:" & periodo.Years)
Log("Month:" & periodo.Months)
Log("Days:" & periodo.Days)
End Sub
It returns me 28 days. OK
The problem
B4X:
DateTime.dateFormat = "dd/MM/yyyy"
Dim periodo As Period
periodo = DateUtils.PeriodBetween(DateTime.DateParse("31/01/2016"),DateTime.DateParse("29/02/2016"))
Log("Year:" & periodo.Years)
Log("Month:" & periodo.Months)
Log("Days:" & periodo.Days)
End Sub
It returns me 1 month.
The right was not 29 days. Why a month?