定制 kuria/clock 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

kuria/clock

Composer 安装命令:

composer require kuria/clock

包简介

Provides access to current date and time that can be mocked for testing purposes

README 文档

README

Provides access to current date and time that can be mocked for testing purposes.

https://travis-ci.com/kuria/clock.svg?branch=master

Contents

Requirements

  • PHP 7.1+

Usage

The Kuria\Clock\Clock class provides access to current date and time.

Getting current time

  • Clock::time(): int
    • get the current UNIX timestamp
  • Clock::microtime(): float
    • get the current UNIX timestamp with microsecond precision
  • Clock::dateTime(?\DateTimeZone $timezone = null): \DateTime
    • get the current date-time
    • uses default time zone if not specified
  • Clock::dateTimeImmutable(?\DateTimeZone $timezone = null): \DateTimeImmutable
    • get the current date-time as an immutable instance
    • uses default time zone if not specified

Overriding current time

  • Clock::override($now): void
    • override the current time
    • $now can be an UNIX timestamp or an instance of DateTimeInterface
    • $now can include microseconds
    • this change only affects methods of the Clock class
  • Clock::isOverridden(): bool
    • see if the current time is currently overridden
  • Clock::resume(): void
    • resume normal operation after the time has been overridden
    • if the time is not currently overridden, this method does nothing

Note

Time overriding is intended only for testing purposes.

统计信息

  • 总下载量: 10.9k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-09-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固