Hello, i have search on forum and tried different solutions but i am missing something.
I want to calculate the time (minutes) elapsed between two dates (date+time)
I have this date stored on remote db and in the following format: yyyy-mm-dd hh:mm:ss
I want to calculate the difference in minutes between now and this date, i did that but is not working ofc
what's wrong? ty
I want to calculate the time (minutes) elapsed between two dates (date+time)
I have this date stored on remote db and in the following format: yyyy-mm-dd hh:mm:ss
I want to calculate the difference in minutes between now and this date, i did that but is not working ofc
B4X:
'sent_date = "xxxx-xx-xx xx:xx:xx"
date = sent_date.SubString2(0,10)'Get date only
minutes = sent_date.SubString2(12,19)'Get time only
'Convert
foo =DateTime.DateTimeParse(datediff, minutes)
'Time elapsed:
period1 = DateUtils.PeriodBetween(foo,DateTime.Now)
elapsed = period1.minutes&"mins"
what's wrong? ty