# How do I convert wallclocktime value to milliseconds

Get help using Construct 2

### » Sun Nov 15, 2015 10:04 am

Hi

I need to convert the wallclocktime value to milliseconds to submit to leaderboard as required.

Time leaderboards present scores in hours / minutes / seconds / hundredths of a second format. You must submit scores as milliseconds, so 66032 would be interpreted as 1:06.03.

I tried simply multiply the value by 1000 but not worked.

I'm using this: floor(wallclocktime_var*1000).

Thanks in advance for any help.
Last edited by RBuster on Tue Nov 17, 2015 12:37 pm, edited 1 time in total.
B
74
S
14
G
4
Posts: 1,045
Reputation: 8,193

### » Sun Nov 15, 2015 3:58 pm

Convert each part into milliseconds. Your example:
1 minute -> 1x60 seconds -> 1x60x1000 milliseconds = 60000
6 seconds -> 6x1000 milliseconds = 6000
3/100 seconds -> 3*(1000/100) = 3*10 milliseconds = 30

60000 + 6000 + 30 = 66030 milliseconds

(I'm guessing 66032 came from doing the calculation as floating point so some round error creeped in).
B
71
S
22
G
273
Posts: 3,825
Reputation: 150,793

### » Tue Nov 17, 2015 12:37 pm

Thanks @blackhornet
B
74
S
14
G
4
Posts: 1,045
Reputation: 8,193