承接 bt51/ntp 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bt51/ntp

Composer 安装命令:

composer require bt51/ntp

包简介

PHP library for interacting with ntp servers

README 文档

README

Package ntp is a simple NTP client. It supports NTP version 4 and SNTP. Note that this client currently does not take network delay into account. This means the time that is received will not be accurate to the nanosecond.

Installation

Create a composer.json in your project

{
    "require": {
        "bt51/ntp": "dev-master"
    }
}

Read more on composer here: http://getcomposer.org

Usage

Getting the current time from an ntp server is simple.

<?php

use Bt51\NTP\Socket;
use Bt51\NTP\Client;

$socket = new Socket('0.pool.ntp.org', 123); 
$ntp = new Client($socket);
$time = $ntp->getTime();
var_dump($time);

The current time returned from the ntp server will be converted to a DateTime object. The timezone will always be UTC.

License

MIT

统计信息

  • 总下载量: 61.59k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 13
  • 点击次数: 15
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 12
  • Watchers: 2
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-03-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固