MCPcopy Create free account
hub / github.com/codemix/graph / toString

Method toString

packages/graph/src/TemporalTypes.ts:461–474  ·  view source on GitHub ↗

* Convert to ISO string with timezone offset.

()

Source from the content-addressed store, hash-verified

459 * Convert to ISO string with timezone offset.
460 */
461 public toString(): string {
462 const h = String(this.#hour).padStart(2, "0");
463 const m = String(this.#minute).padStart(2, "0");
464 const s = String(this.#second).padStart(2, "0");
465
466 let timeStr = `${h}:${m}:${s}`;
467 if (this.#nanosecond > 0) {
468 let nanos = String(this.#nanosecond).padStart(9, "0");
469 nanos = nanos.replace(/0+$/, "");
470 timeStr += `.${nanos}`;
471 }
472
473 return timeStr + this.#formatOffset();
474 }
475
476 public compareTo(other: TimeValue): number {
477 // Compare by normalized UTC time

Callers

nothing calls this directly

Calls 1

#formatOffsetMethod · 0.95

Tested by

no test coverage detected