MCPcopy
hub / github.com/vogler/free-games-claimer / datetime

Function datetime

src/util.js:21–21  ·  view source on GitHub ↗
(d = new Date())

Source from the content-addressed store, hash-verified

19export const datetimeUTC = (d = new Date()) => d.toISOString().replace('T', ' ').replace('Z', '');
20// same as datetimeUTC() but for local timezone, e.g., UTC + 2h for the above in DE
21export const datetime = (d = new Date()) => datetimeUTC(new Date(d.getTime() - d.getTimezoneOffset() * 60000));
22export const filenamify = s => s.replaceAll(':', '.').replace(/[^a-z0-9 _\-.]/gi, '_'); // alternative: https://www.npmjs.com/package/filenamify - On Unix-like systems, / is reserved. On Windows, <>:"/\|?* along with trailing periods are reserved.
23
24export const handleSIGINT = (context = null) => process.on('SIGINT', async () => { // e.g. when killed by Ctrl-C

Callers 6

prime-gaming.jsFile · 0.90
aliexpress.jsFile · 0.90
epic-games.jsFile · 0.90
gog.jsFile · 0.90
unrealengine.jsFile · 0.90

Calls 1

datetimeUTCFunction · 0.85

Tested by

no test coverage detected