MCPcopy Index your code
hub / github.com/Tencent/CodeAnalysis / secToHMS

Function secToHMS

web/packages/shared/util/time.ts:28–35  ·  view source on GitHub ↗
(sec: number|string)

Source from the content-addressed store, hash-verified

26 * @returns H 时 m 分 s 秒
27 */
28export const secToHMS = (sec: number|string) => {
29 const time = Moment.duration(sec, 'seconds');
30 const h = time.hours();
31 const m = time.minutes();
32 const s = time.seconds();
33 const format = `${h ? 'H 时 ' : ''}${m ? 'm 分 ' : ''}s 秒`;
34 return Moment({ h, m, s }).format(format);
35};

Callers 2

getColumnsFunction · 0.90
getColumnsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected