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

Function formatDateTime

wxapp/nice.js:62–66  ·  view source on GitHub ↗
(timestamp)

Source from the content-addressed store, hash-verified

60}
61
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
68function zeroPad(buffer) {
69 const rest = buffer.length % 16;

Callers 1

encryptPayloadFunction · 0.85

Calls 1

padFunction · 0.70

Tested by

no test coverage detected