(timestamp: RowValue_Timestamp)
| 93 | }; |
| 94 | |
| 95 | const formatTimestamp = (timestamp: RowValue_Timestamp) => { |
| 96 | const fullDayjs = dayjs( |
| 97 | getDateForPbTimestampProtoEs(timestamp.googleTimestamp) |
| 98 | ).utc(); |
| 99 | const microseconds = Math.floor( |
| 100 | (timestamp.googleTimestamp?.nanos ?? 0) / |
| 101 | Math.pow(10, 9 - timestamp.accuracy) |
| 102 | ); |
| 103 | const formattedTimestamp = |
| 104 | microseconds > 0 |
| 105 | ? `${fullDayjs.format("YYYY-MM-DD HH:mm:ss")}.${microseconds.toString().padStart(timestamp.accuracy, "0")}` |
| 106 | : `${fullDayjs.format("YYYY-MM-DD HH:mm:ss")}`; |
| 107 | return formattedTimestamp; |
| 108 | }; |
| 109 | |
| 110 | const formatTimestampWithTz = (timestampTzValue: RowValue_TimestampTZ) => { |
| 111 | const fullDayjs = dayjs( |
no test coverage detected