The NetworkTimeProtocol class provides utility methods for working with NTP (Network Time Protocol) timestamps in PHP.

Maintainers

👁 aminyazdanpanah

Package info

github.com/PHP-WebRTC/ntp

Homepage

pkg:composer/quasarstream/ntp

Fund package maintenance!

php-webrtc

Statistics

Installs: 1 212

Dependents: 2

Suggesters: 0

Stars: 1

Open Issues: 0

v1.0.0 2025-05-13 11:46 UTC

Requires

  • php: ^8.4
  • ext-gmp: *

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

BSD-3-Clause 032a491e5add4a54514c8d1c33b61248fdfe1ed6

  • Amin Yazdanpanah <github.woop@aminyazdanpanah.com>
  • Sana Moniri <s.mo.woop@quasarstream.com>
  • Quasar Stream Community

ntpmulticastdns

This package is auto-updated.

Last update: 2026-06-13 14:19:39 UTC


README

👁 PHP Version
👁 License

The NetworkTimeProtocol class provides utility methods for working with NTP (Network Time Protocol) timestamps in PHP. It is part of the PHP WebRTC package and supports conversion between NTP timestamps and PHP DateTimeImmutable objects. Internally, it uses GMP to handle 64-bit fixed-point representations of time.

Features

  • Convert current time to NTP timestamp (64-bit fixed-point)

  • Convert NTP timestamp to DateTimeImmutable

  • Accurate fractional second handling

  • Uses GMP for high-precision arithmetic

  • Fully UTC-compliant

Requirements

  • PHP ≥ 8.4

Documentation

This package is part of the PHP WebRTC library. For complete documentation, examples, and API reference, visit:

PHP WebRTC Documentation

Credits

Authors

Reporting Issues

Found a bug? Please report it on our issues.

License

BSD 3-Clause License. See LICENSE for details.