Android Question Comparing 2 date time values in b4A and displaying date in dd-Mon-yyyy hh:mm AMPM format - reg.

beelze69

Active Member
Licensed User
Longtime User
Hi,

I have the following doubts with regard to handling date and time in b4A:

1) I have to perform the following validation:

If input Date=System Date then
the input time should not be within 1 hour from the system time
i.e. if the input date equals the system date and the current time is 11:30 am then the input time should
be greater than or equal to 12:30 pm...



For date comparison we can use the
DateTime.Date(lnginputDate)=DateTime.Date(lngsystemDate)
{Where lnginputDate=Datetime.DateParse(inputdate)
and lngSystemDate=Datetime.DateParse(DateTime.Now) }

For hour difference we can use

Dim PerDiff as Period
PerDiff=DateUtils.PeriodBetween(Datetime.DateParse(inputDate),DateTime.now)

Log("Difference in Minutes:" & Perdiff.Minutes)

However, I have my input date as a string in dd-mm-yyyy hh:mm format ,for example: 21-02-2022 11:10

And DateTime.DateFormat = "dd-MM-yyyy hh:mm" is not acceptable.

So how can we do the above comparison in such case ?

2) In SQLLITE (and via DateTime/DateUtils), how does one display the date 21-02-2022 21:05 as
as 21-Feb-2022 9:05 pm ?


Require some assistance on the above.

Thanks..
 
Last edited:

AnandGupta

Expert
Licensed User
Longtime User
Is Clipper still used ? I mean.. now that DOS is gone... You have Clipper apps still running ?
Well it depends how important the developed app is. Our company still uses the Attendance System I developed in Clipper, under DOSBox in 64bit Windows machine !

I have converted many of my Clipper programs into 32bits using Harbour. I also use HMG MiniGUI Extened to make customized applications which generates single exe for Windows without need for any dll like XBase++. Also all my small freeware are developed in AutoHotKey and AutoIt3.
 
Upvote 0
Top