MCPcopy Create free account
hub / github.com/AS-AIGC/TranscriptHub / generate_timestamp

Function generate_timestamp

apps/backend/logger.js:61–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

59}
60
61function generate_timestamp() {
62 const UTC8_OFFSET = 0; // Correct UTC+8 offset
63 const t = new Date((new Date().getTime()) + UTC8_OFFSET * 60 * 60 * 1000);
64
65 const year = t.getFullYear();
66 const month = pad_number(t.getMonth() + 1);
67 const day = pad_number(t.getDate());
68 const hours = pad_number(t.getHours());
69 const minutes = pad_number(t.getMinutes());
70 const seconds = pad_number(t.getSeconds());
71
72 return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
73}
74
75function formatted_message(timestamp, level, message) {
76 const formatted = typeof message === 'object' ? JSON.stringify(message, null, 2) : message;

Callers 1

loggerFunction · 0.85

Calls 1

pad_numberFunction · 0.85

Tested by

no test coverage detected