Time between

bobsimoneau

Member
Licensed User
Longtime User
I am having trouble with something I thought would be easy. I just can not seems to get it. I am trying to create a countdown from now to my wedding on Aug 10th, 2012 5:30 pm. I am looking to get:

Days Hours Mins Secs

My concept was to take the number of ticks between and convert to seconds and then do the math for each. I must be getting old, as this is beating me up. I would appreciate any help.
 

SandroB4A

Member
Licensed User
Longtime User
Explanations for:
B4X:
DateTicks = DateTime.DateParse(Date) + (DateTime.TimeParse(Time) - DateTime.DateParse(DateTime.Date(DateTime.Now)))
DateTime.TimeParse(Time) returns the ticks of today + the ticks of the given time!
DateTime.DateParse(DateTime.Date(DateTime.Now)) returns the ticks for today at 0h00 !
DateTime.TimeParse(Time) - DateTime.DateParse(DateTime.Date(DateTime.Now)) returns only the ticks for the given time.

DateTime.Now returns the ticks of today + the ticks of the current time.

Best regards.

Ok, now I understand, tks Klaus!
 
Upvote 0
Top