| 185 | } |
| 186 | |
| 187 | function formatTimezone(seconds: number, modifiers: LogcatFormatModifiers) { |
| 188 | if (!modifiers.timezone || modifiers.monotonic || modifiers.epoch) { |
| 189 | return ""; |
| 190 | } |
| 191 | |
| 192 | const date = new Date(seconds * 1000); |
| 193 | const offset = date.getTimezoneOffset(); |
| 194 | const sign = offset <= 0 ? "+" : "-"; |
| 195 | const absolute = Math.abs(offset); |
| 196 | const hours = (absolute / 60) | 0; |
| 197 | const minutes = absolute % 60; |
| 198 | |
| 199 | // prettier-ignore |
| 200 | return ` ${ |
| 201 | sign |
| 202 | }${ |
| 203 | hours.toString().padStart(2, "0") |
| 204 | }:${ |
| 205 | minutes.toString().padStart(2, "0") |
| 206 | }`; |
| 207 | } |
| 208 | |
| 209 | function formatTime( |
| 210 | seconds: number, |