Hi,
There is probably better ways, but this seems to work.
B4X:
Sub getDates
Dim lstDates,lstDates2 As List
lstDates.Initialize
lstDates2.Initialize
stripTime(startDate)
Do While startDate+DateTime.TicksPerDay<endDate
startDate=startDate+DateTime.TicksPerDay
lstDates.Add(startDate)
lstDates2.Add(DateTime.Date(startDate))
Loop
For i=0 To lstDates.Size-1
Log(lstDates.Get(i))
Log(lstDates2.Get(i))
Next
End Sub
Sub stripTime(Ticks As Long) As Long 'remove time
Return DateUtils.SetDate(DateTime.GetYear(Ticks), _
DateTime.GetMonth(Ticks),DateTime.GetDayOfMonth(Ticks))
End Sub
Hi,
Thank you for your Help!
I have solved the problem like this.
B4X:
Sub cal_days(start As Long, ende As Long)
TempDates.Clear
Dim wert,sum,zw As Long
Dim i As Int
If start > ende Or start = ende Then
Log("Fehler Datum")
Dayslabel.Text="Fehler Datum"
Else
wert = ende-start
zw = wert/1000/ 60 / 60 / 24+2
Log(zw & " Tage")
Dayslabel.Text=zw & " Tage"
For i= 0 To zw-1
sum = DateTime.Add(start,0,0,i)
'Log(DateTime.Date(sum))
TempDates.Add(DateTime.Date(sum))
Next
End If
End Sub