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

Method time

jd_goodMorning.js:419–433  ·  view source on GitHub ↗
(t, e = null)

Source from the content-addressed store, hash-verified

417 }
418 }
419 time(t, e = null) {
420 const s = e ? new Date(e) : new Date;
421 let i = {
422 "M+": s.getMonth() + 1,
423 "d+": s.getDate(),
424 "H+": s.getHours(),
425 "m+": s.getMinutes(),
426 "s+": s.getSeconds(),
427 "q+": Math.floor((s.getMonth() + 3) / 3),
428 S: s.getMilliseconds()
429 };
430 /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length)));
431 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)));
432 return t
433 }
434 msg(e = t, s = "", i = "", r) {
435 const o = t => {
436 if (!t) return t;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected