* Format timezone offset as +HH:MM or -HH:MM.
()
| 445 | * Format timezone offset as +HH:MM or -HH:MM. |
| 446 | */ |
| 447 | #formatOffset(): string { |
| 448 | if (this.#offsetSeconds === 0) return "Z"; |
| 449 | |
| 450 | const sign = this.#offsetSeconds >= 0 ? "+" : "-"; |
| 451 | const absSeconds = Math.abs(this.#offsetSeconds); |
| 452 | const hours = Math.floor(absSeconds / 3600); |
| 453 | const mins = Math.floor((absSeconds % 3600) / 60); |
| 454 | |
| 455 | return `${sign}${String(hours).padStart(2, "0")}:${String(mins).padStart(2, "0")}`; |
| 456 | } |
| 457 | |
| 458 | /** |
| 459 | * Convert to ISO string with timezone offset. |