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

Method time

jd_redPacket.js:1787–1793  ·  view source on GitHub ↗
(t, e = null)

Source from the content-addressed store, hash-verified

1785 }
1786
1787 time(t, e = null) {
1788 const s = e ? new Date(e) : new Date;
1789 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()};
1790 /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length)));
1791 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)));
1792 return t
1793 }
1794
1795 msg(e = t, s = "", i = "", r) {
1796 const o = t => {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected