How Precision Time Protocol handles leap seconds
Feb 3, 2025Oleg Obleukhov, Patrick Cullen

Summary
This post details Meta's approach to handling leap seconds within the Precision Time Protocol (PTP) ecosystem. It introduces a 'self-smearing' algorithm for the fbclock library that shifts time by 1 nanosecond every 62.5 microseconds, providing a stateless and reproducible method for PTP synchronization. The post also discusses the tradeoffs of this approach, such as potential timestamp mismatches with NTP systems that use quadratic smearing, and highlights the benefits of using Coordinated Universal Time (UTC) over International Atomic Time (TAI) to avoid leap second complexities. It advocates for the industry-wide freeze of new leap seconds after 2035 to simplify timekeeping infrastructure.