Convert Hour, minute, seconds and miliseconds

Hi, I have imported a cvs file and have gotten 00:00:07.090 in A1

I want to convert it to 007.09, that will say into seconds and tenth of a second.

How do i do that?

You can use an auxiliar column. If data is in A1, in B1 type =A1*24*60*60 and format (Ctrl+1) as number with format code 000.00.

Tested with LibreOffice 6.4.7.2 (x86); OS: Windows 6.1.


Add Answer is reserved for solutions. If you think the answer is not satisfactory, add a comment below, or click edit (below your question) to add more information. Thanks.

Check the mark (Answer markCorrect answer mark) to the left of the answer that solves your question.

When your entries show the trailing zero in the decimal fraction without you having formatted it to do so, this indicates that the times have been imported as text, not as numbers. You can use the VALUE() or TIMEVALUE() function to convert text to a proper time value, which you can then keep as is and format for time display, or multiply by 86400 as per @LeroyG’s answer to have a readily available count of seconds for further calculations.

If you keep the time value (where times are stored internally as “fraction of a day”) the H/M/S placeholders are used to display hours/minutes/seconds. You need square brackets round the seconds segment of the format code to “accumulate seconds” (to avoid the value wrapping on the passing of each minute): [SSS].00

Note that you asked for “tenths of a second” but your example displays to the hundredth of a second.

Note also that the formatting does not change the stored value. If there are differences at the thousandth, they will be taken into consideration when comparing or calculating with times, even when your format suppresses them from display. To actually “convert” to tenth/hundredth precision, you need to apply rounding to your number.

Please also note that the (dangerous and better deprecated) option Precision as shown will not work with time formats.
If you (the OriginalQuestioner) actually want to round a timevalue imported in the exemplified format as a text (say in cell A1), you can use =MROUND(TIMEVALUE(A1);1/864000) to get the value rounded to tenths of a second, and then to display it in any format you choose.

(An ordinary day has 86400 s. UTC-leap-seconds and mainly silly “DST” may spoil this. To decide if a duration in high resolution makes sense at all, we need to know in what way the value was obtained. If something like a NOW() function was used, a duration shown as 1 s may actually span 3601 s e.g.)