Инструменты пользователя

Инструменты сайта


en:tcmediainfo:documentation:script_timingformat

TimingFormat

This function for counting and format timing values from the value in milliseconds.

TimingFormat(Format, Timing)
FormatTiming format, can be constructed from any text with substitutes. The list of substitutes in table below.
TimingTiming in milliseconds.

Return string formatted with given substitutions. If timing value can't be converted to numeric value, function return empty string.

Substitutions

%h hour, ex. 1 hour → 1
%hh hour with one leading zero, ex. 1 hour → 01
%hhh hour with two leading zeros, ex. 1 hour → 001
%m minutes, ex. 5 min → 5
%mm minutes with leading zero, ex. 5 min → 05
%s seconds, ex. 5 sec → 5
%ss seconds with leading zero, ex. 5 sec → 05
%z thouthand's fractions of second (= milliseconds), ex. 25 ms → 25
%fff thouthand's fractions of second (= milliseconds), with leading zeros, ex. 25 ms → 025
%ff fractions of milliseconds rounded to hundreds, with leading zeros, ex. 125 ms → 13
%f fractions of milliseconds rounded to ten's, ex. 125 ms → 1

Example

TimingFormat('%hh:%mm%:%ss.%fff', 183353) → '00:03:03.353'
en/tcmediainfo/documentation/script_timingformat.txt · Последнее изменение: 2019/02/11 23:31 — loopback

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki