Yo guys

I have a problem (big/small, you choose).
I have to code a little app but I'm stuck with some math thing.
Here's what i want to do.

The app has to calculate the time the horses had to have to run 1000m.
Let's give an example.

A horse has run 1800m and his time was 2m 30s and 5ms.
That makes a total of 120 + 30 = 150 seconds.

That's the time for 1800m
Now i need to time for 1000m.

After that, you still have the time in seconds.
And now this has to be converted back to minutes and seconds.

And that's the time i need.

Let's give an example.

Distance: 2350m
Total time: 3065 (3m, 6s, 5ms)
SOLUTION: Kilometertime: 1.19.4

Another one

Distance: 1800m
Total time: 2352
Kilometertime: 1.26.2

I would be very happy if somebody could code that for me.
I would be really gratefull if I recieved the source code (coding language doesn't matter) , so i could modify it to my needs.

I'm very sorry if I posted this in the wrong section...

Greetings

Koetje from Belgium