PHPackages                             hixbe/time - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. hixbe/time

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

hixbe/time
==========

High-precision NTP time synchronization package with CLI tools

016PHPCI passing

Since Dec 16Pushed 5mo agoCompare

[ Source](https://github.com/hixbehq/php-time)[ Packagist](https://packagist.org/packages/hixbe/time)[ RSS](/packages/hixbe-time/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

hixbe/time
==========

[](#hixbetime)

**High-precision NTP time synchronization package with powerful CLI tools**

A professional-grade PHP package for querying NTP servers and synchronizing system time with network time servers. Built with Hixbe's primary server `time.hixbe.com` for ultra-reliable time synchronization.

[![PHP Version](https://camo.githubusercontent.com/7663c9d53dc13cedaf0660a8745a7e77d2dd711257f36aa86ebce12a0600ef42/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e312d626c75652e737667)](https://www.php.net/)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)

Features
--------

[](#features)

✨ **Rich Feature Set**

- 🚀 High-performance NTP client
- 📊 Raw packet inspection &amp; analysis
- ⏱️ Precise timestamp conversion (NTP to Unix)
- 🔄 Continuous sync mode with configurable intervals
- 📡 Multiple server support (Hixbe, pool.ntp.org, etc.)
- 📋 Detailed verbose reporting
- 🎨 Beautiful CLI with multiple output formats
- 🔐 Type-safe implementation with readonly properties
- ⚡ Minimal dependencies (requires sockets extension)

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- sockets extension enabled

Installation
------------

[](#installation)

```
composer require hixbe/time
```

Quick Start
-----------

[](#quick-start)

### CLI Usage

[](#cli-usage)

```
# Get current time from Hixbe server
./vendor/bin/hixbe-time

# Verbose mode with raw packet details
./vendor/bin/hixbe-time --verbose

# Output as JSON
./vendor/bin/hixbe-time --json

# Get time offset (useful for scripts)
./vendor/bin/hixbe-time --offset

# Continuous synchronization (every 5 seconds)
./vendor/bin/hixbe-time --continuous

# Custom interval (every 2 seconds)
./vendor/bin/hixbe-time --continuous --interval 2000

# Query different server
./vendor/bin/hixbe-time --server pool.ntp.org --verbose

# Show only the offset
./vendor/bin/hixbe-time --offset
```

### Programmatic Usage

[](#programmatic-usage)

```
