I have to show a alert if given sql entry is atmost twodays old
i have date field in DB i
but it shows all the time .
I debug the app n figure out that DateTime.Date(DateTime.Now)) give random date value. ???
why datetime.now() is not giving me todays date???
Is there way to achieve this?
i have date field in DB i
B4X:
DateTime.dateFormat = "yyyy-mm-dd"
Dim p As Period
'values(1).text is date in sql
p=DateUtils.PeriodBetween(DateTime.DateParse(values1(1).text),DateTime.DateParse(DateTime.Date(DateTime.Now)))
Dim itt1 As Int=0
itt1= p.Days*24*60 +p.Hours*60 +p.Minutes
If itt1<= 2880 Then
g_panel2.AddView(values1(0),0,0,100%x,100%y)
End If
but it shows all the time .
I debug the app n figure out that DateTime.Date(DateTime.Now)) give random date value. ???
why datetime.now() is not giving me todays date???
Is there way to achieve this?