MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / pad

Function pad

wxapp/nice.js:64–64  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

62function formatDateTime(timestamp) {
63 const d = new Date(timestamp * 1000);
64 const pad = (n) => String(n).padStart(2, "0");
65 return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} ${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`;
66}
67

Callers 1

formatDateTimeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected