MCPcopy Index your code
hub / github.com/bytebase/bytebase / formatTime

Function formatTime

frontend/src/react/components/task-run-log/model.ts:63–75  ·  view source on GitHub ↗
(timestamp?: Timestamp)

Source from the content-addressed store, hash-verified

61};
62
63export const formatTime = (timestamp?: Timestamp): string => {
64 if (!timestamp) return "--:--:--.---";
65 const date = new Date(getTimestampMs(timestamp));
66 return (
67 [
68 date.getHours().toString().padStart(2, "0"),
69 date.getMinutes().toString().padStart(2, "0"),
70 date.getSeconds().toString().padStart(2, "0"),
71 ].join(":") +
72 "." +
73 date.getMilliseconds().toString().padStart(3, "0")
74 );
75};
76
77export const formatDuration = (ms: number): string => {
78 if (ms < 1) return "<1ms";

Callers 1

buildDisplayItemsFunction · 0.85

Calls 2

getTimestampMsFunction · 0.85
toStringMethod · 0.65

Tested by

no test coverage detected