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

Function timeFormat

backUp/xmSports.js:160–168  ·  view source on GitHub ↗
(time)

Source from the content-addressed store, hash-verified

158 return new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000;
159}
160function timeFormat(time) {
161 let date;
162 if (time) {
163 date = new Date(time)
164 } else {
165 date = new Date();
166 }
167 return date.getFullYear() + '-' + ((date.getMonth() + 1) >= 10 ? (date.getMonth() + 1) : '0' + (date.getMonth() + 1)) + '-' + (date.getDate() >= 10 ? date.getDate() : '0' + date.getDate());
168}
169//随机生成m(小)到n(大)的数,包含m和n
170function randomFriendPin(m,n) {
171 return Math.round(Math.random()*(n - m) + m);

Callers 2

startFunction · 0.70
change_stepFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected