Android Question Calculating days between dates

Ulli_53

Member
Licensed User
I am using the following code in B4i: (using DateUtils)

Dim diff As Period
DateTime.DateFormat="dd.MM.yyyy HH:mm:ss"
diff = DateUtils.PeriodBetweenInDays(DateTime.Now, DateTime.DateParse("27.07.2016 23:59:59"))
Label1.Text = diff.Days

Why does this code not work in B4A?
 

Ulli_53

Member
Licensed User
Please use [code]code here...[/code] tags when posting code.
Sorry, I am new here. I will remember next time.
In which way doesn't it work?
In order to tell you the exact compiler errors with line numbers I put in the same code again.
And hey, now it works!
I do not know what was wrong before. Nevertheless it works.
So it was just a successful test how to share code between B4i and B4A.
Thanks for your effort.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…