Hi!
I am using ANotherDatePicker for take a date from my phone. I have a problem when I take a date in the past . To check if the date is in the past I do this
When I take the same day it told me that is wrong date because it uses timestamp so the date from ANotherPicker is YYYY-MM-DD 00:00 so it is less than the date taken.
There is a way to take just date without time to compare only dates without hours ?
TIA
I am using ANotherDatePicker for take a date from my phone. I have a problem when I take a date in the past . To check if the date is in the past I do this
B4X:
Sub ADP_Closed (Cancelled As Boolean, Date As Long)
If Cancelled = False AND Date < DateTime.Now Then
'future time
Msgbox("Wrong Date ","test")
ADP.SetDate(DateTime.Now, True)
Else
Dim s As String
DateTime.DateFormat="yyyy-MM-dd"
s= DateUtils.TicksToString(Date)
s= s.SubString2(0,s.IndexOf(" "))
Msgbox(s,"test")
EndIf
Log("Cancelled = " & Cancelled & ", Date = " & DateUtils.TicksToString(Date))
End Sub
When I take the same day it told me that is wrong date because it uses timestamp so the date from ANotherPicker is YYYY-MM-DD 00:00 so it is less than the date taken.
There is a way to take just date without time to compare only dates without hours ?
TIA