All Projects → ergebnis → clock

ergebnis / clock

Licence: MIT license
⏰ Provides a simple abstraction of a clock.

Programming Languages

PHP
23972 projects - #3 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to clock

React Clock
An analog clock for your React app.
Stars: ✭ 149 (+365.63%)
Mutual labels:  clock
Evangelion Clock Screensaver
A digital clock screensaver inspired by the graphical interfaces from Neon Genesis Evengelion.
Stars: ✭ 234 (+631.25%)
Mutual labels:  clock
LWClock
Multifunctional clock based on ESP8266 and MAX79xxx for Home Automation (IoT)
Stars: ✭ 40 (+25%)
Mutual labels:  clock
Swiftclockui
SwiftUI library to display a clock. You can move the arms to change the time, change the style of the clock and customise some configurations.
Stars: ✭ 159 (+396.88%)
Mutual labels:  clock
Marquee Scroller
Marquee Scroller Clock News Weather and More
Stars: ✭ 211 (+559.38%)
Mutual labels:  clock
Grid Clock Screensaver
Grid clock macOS screensaver
Stars: ✭ 245 (+665.63%)
Mutual labels:  clock
Mac Hanguldesktop Clock
Hangul Desktop Clock for Mac
Stars: ✭ 146 (+356.25%)
Mutual labels:  clock
time
The simplest but configurable online clock
Stars: ✭ 77 (+140.63%)
Mutual labels:  clock
Cornercal
A simple, clean calendar and clock app for macOS.
Stars: ✭ 213 (+565.63%)
Mutual labels:  clock
ColorClockSaver
A screensaver for macOS
Stars: ✭ 57 (+78.13%)
Mutual labels:  clock
Clock
A low consumption, low latency support for frequent updates of large capcity timing manage
Stars: ✭ 161 (+403.13%)
Mutual labels:  clock
Hgcircularslider
A custom reusable circular / progress slider control for iOS application.
Stars: ✭ 2,240 (+6900%)
Mutual labels:  clock
Animated Clock Icon
Easy-to-use animated clock icon for Android
Stars: ✭ 253 (+690.63%)
Mutual labels:  clock
Server Date
Make the server's clock available in the browser.
Stars: ✭ 157 (+390.63%)
Mutual labels:  clock
pink-0
Ableton Link to clock/reset signals converter
Stars: ✭ 87 (+171.88%)
Mutual labels:  clock
Carettab
CaretTab - New Tab Page Replacement
Stars: ✭ 147 (+359.38%)
Mutual labels:  clock
Clock Bar
Macbook | Clock, right on the touch bar
Stars: ✭ 237 (+640.63%)
Mutual labels:  clock
worldclock
A Sci-fi looking World Clock created using JavaFX.
Stars: ✭ 28 (-12.5%)
Mutual labels:  clock
kde-plasmoid-betterinlineclock
Your usual clock widget, just way better and on a single line!
Stars: ✭ 18 (-43.75%)
Mutual labels:  clock
ardusamber
Desamber time Arduino corporealization
Stars: ✭ 20 (-37.5%)
Mutual labels:  clock

clock

Integrate Prune Release Renew

Code Coverage Type Coverage

Latest Stable Version Total Downloads

Provides a simple abstraction of a clock, following the suggestion by Martin Fowler.

Installation

Run

$ composer require ergebnis/clock

Usage

SystemClock

Create a new system clock and use it to determine the current time:

<?php

use Ergebnis\Clock;

$timeZone = new \DateTimeZone('Europe/Berlin');

$clock = new Clock\SystemClock($timeZone);

$now = $clock->now();

FrozenClock

Create a new frozen clock and use it in tests:

<?php

use Ergebnis\Clock;

$now = new \DateTimeImmutable();

$clock = new Clock\FrozenClock($now);

sleep(5);

$stillNow = $clock->now();

Alternatively, create a new frozen clock by freezing a system clock:

<?php

use Ergebnis\Clock;

$timeZone = new \DateTimeZone('Europe/Berlin');

$clock = new Clock\SystemClock($timeZone);

$frozenClock = $clock->freeze();

$now = $clock->now();

sleep(5);

$stillNow = $clock->now();

Changelog

Please have a look at CHANGELOG.md.

Contributing

Please have a look at CONTRIBUTING.md.

Code of Conduct

Please have a look at CODE_OF_CONDUCT.md.

License

This package is licensed using the MIT License.

Please have a look at LICENSE.md.

Credits

This project is inspired by lcobucci/clock (originally licensed under MIT by Luís Cobucci).

Curious what I am building?

📬 Subscribe to my list, and I will occasionally send you an email to let you know what I am working on.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].