MCPcopy Create free account
hub / github.com/Treeki/BirdBridge / convertTimestamp

Function convertTimestamp

conversion.ts:19–32  ·  view source on GitHub ↗
(ts: string)

Source from the content-addressed store, hash-verified

17 'Dec': '12'
18};
19export function convertTimestamp(ts: string): string {
20 const bits = /^... (...) (\d\d) (\d\d):(\d\d):(\d\d) \+.... (\d\d\d\d)$/.exec(ts);
21 if (bits !== null) {
22 const month = MONTHS[bits[1]];
23 const day = bits[2];
24 const hour = bits[3];
25 const minute = bits[4];
26 const second = bits[5];
27 const year = bits[6];
28 return `${year}-${month}-${day}T${hour}:${minute}:${second}.000Z`;
29 } else {
30 return '1970-01-01T00:00:00.000Z';
31 }
32}
33export function convertPollTimestamp(ts: string): string {
34 return ts.substring(0, ts.length - 1) + '.000Z';
35}

Callers 3

userToAccountFunction · 0.85
tweetToTootFunction · 0.85
activityToNotificationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected