MCPcopy Create free account
hub / github.com/Script-Hub-Org/Script-Hub / time

Method time

env/env.js:353–369  ·  view source on GitHub ↗
(t, e = null)

Source from the content-addressed store, hash-verified

351 }
352 }
353 time(t, e = null) {
354 const s = e ? new Date(e) : new Date()
355 let a = {
356 'M+': s.getMonth() + 1,
357 'd+': s.getDate(),
358 'H+': s.getHours(),
359 'm+': s.getMinutes(),
360 's+': s.getSeconds(),
361 'q+': Math.floor((s.getMonth() + 3) / 3),
362 S: s.getMilliseconds(),
363 }
364 ;/(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + '').substr(4 - RegExp.$1.length)))
365 for (let e in a)
366 new RegExp('(' + e + ')').test(t) &&
367 (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? a[e] : ('00' + a[e]).substr(('' + a[e]).length)))
368 return t
369 }
370 queryStr(t) {
371 let e = ''
372 for (const s in t) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected