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

Method epochSeconds

packages/graph/src/TemporalTypes.ts:904–911  ·  view source on GitHub ↗

* Get the epoch seconds (seconds since 1970-01-01T00:00:00Z).

()

Source from the content-addressed store, hash-verified

902 * Get the epoch seconds (seconds since 1970-01-01T00:00:00Z).
903 */
904 public get epochSeconds(): number {
905 const date = new Date(
906 Date.UTC(this.#year, this.#month - 1, this.#day, this.#hour, this.#minute, this.#second),
907 );
908 // Adjust for timezone offset
909 const ms = date.getTime() - this.#offsetSeconds * 1000;
910 return Math.floor(ms / 1000) + Math.floor(this.#nanosecond / 1_000_000_000);
911 }
912
913 /**
914 * Get the epoch milliseconds (milliseconds since 1970-01-01T00:00:00Z).

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected