MCPcopy Create free account
hub / github.com/Semporia/Scripts / time

Method time

jd_api_test.js:334–340  ·  view source on GitHub ↗
(t, e = null)

Source from the content-addressed store, hash-verified

332 }
333
334 time(t, e = null) {
335 const s = e ? new Date(e) : new Date;
336 let i = {"M+": s.getMonth() + 1, "d+": s.getDate(), "H+": s.getHours(), "m+": s.getMinutes(), "s+": s.getSeconds(), "q+": Math.floor((s.getMonth() + 3) / 3), S: s.getMilliseconds()};
337 /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length)));
338 for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length)));
339 return t
340 }
341
342 msg(e = t, s = "", i = "", r) {
343 const o = t => {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected