isValidPtpTimestamp
Signature
Section titled “Signature”isValidPtpTimestamp(value: unknown): value is PtpTimestamp | { seconds: number; nanoseconds: number; }Return true when value is a PTP timestamp record that ptpToUtc reads. It checks the ranges of the 80-bit PTP (IEEE 1588) timestamp: 32 bits of nanoseconds (RFC 8877 section 4.3) and the other 48 bits (80 - 32) of seconds, the nanoseconds in 0 to 10^9 - 1.
secondsis abigint, or a safe-integernumber, from 0 to 2^48 - 1.nanosecondsis an integernumberfrom 0 to 999 999 999.- Both members are required. Extra members are ignored.
- It checks the record, not a conversion. A record that passes can still make
ptpToUtcreturn"": when the result would fall before 1970 ({ seconds: 0n, nanoseconds: 0 }with an offset of 37), or past Temporal’s last instant,+275760-09-13T00:00:00Z. - It narrows
valueto a PTP timestamp record. Never throws: a Proxy or a throwing getter is not a valid record.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value | unknown | candidate value of any type |
Returns
Section titled “Returns”true for a PTP timestamp record, or false on invalid input
Related types
Section titled “Related types”Examples
Section titled “Examples”import { isValidPtpTimestamp } from "@northguild/gmt/iot/validate";
isValidPtpTimestamp({ seconds: 1704067237n, nanoseconds: 0 }) // trueSource
Section titled “Source”© 2026 NorthGuild · Licences
Code examples: MIT-0. Packages: MIT. Third-party data and components: their own licences, credited where they appear. Everything else: © 2026 NorthGuild, all rights reserved.