(ts: string)
| 17 | 'Dec': '12' |
| 18 | }; |
| 19 | export 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 | } |
| 33 | export function convertPollTimestamp(ts: string): string { |
| 34 | return ts.substring(0, ts.length - 1) + '.000Z'; |
| 35 | } |
no outgoing calls
no test coverage detected