Hello.

I need some help in deducing time in a game.

The current time is (06:45:10)

I have two fleets that is send to attack a planet.

The first fleets arrival time is known (10:31:15) 24 hour format

The second fleets time to get to the target planet is known (01:58:58) flight duration.


I want to send the second fleet so that it will arrive at the same time at the target planet to do a combined attack. How do you add or subtract the time of the second fleet so that it will arrive at the same time?

Use two date time pickers to set the time values and display the second fleets send time in a label,when the second fleet should be send from current time.

The game runs in realtime.

Can Anyone be of assistance?

Thanks in Advance

Recommended Answers

All 3 Replies

You can use the following to determine the time difference between your two dates -

Dim x As Date, y As Date, z As Date

x = Format("10:31:15", "hh:mm:ss")
y = Format("01:58:58", "hh:mm:ss")
z = x - y

Label1.Caption = z

Thanks for the advice. It works pefectly.

It's a pleasure. Please mark this thread as solved, thanks.

Happy coding:)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.