Download the PHP package joefallon/phptime without Composer

On this page you can find all versions of the php package joefallon/phptime. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package phptime

phptime

Lightweight, well-tested utilities for working with time in PHP — designed for simplicity, clarity, and testability. Useful when you need small, dependable helpers like a high-resolution chronograph, readable day/month enums, or MySQL-compatible timestamps.

This library favors explicit, testable APIs and minimal dependencies. It's not a full-featured date/time framework — instead, it provides pragmatic, focused tools that many PHP apps need.

Why Use This Library?

Table of Contents


Installation

Install via Composer (recommended):

If you're a library author, add it to your composer.json as a dependency and run:


Quick Start

Chronograph (Measure Elapsed Time)

MySQL DATETIME Strings

Days and Months Enum Helpers


API Reference

Chronograph

Namespace: JoeFallon\PhpTime\Chronograph

A high-resolution timer for measuring elapsed time.

Methods:

Example with Dependency Injection:


DaysEnum and MonthsEnum

Namespaces: JoeFallon\PhpTime\DaysEnum, JoeFallon\PhpTime\MonthsEnum

Value-object style enums exposing full-name constants and short aliases (e.g., MonthsEnum::JANUARY and MonthsEnum::JAN) with helper methods:

Example:


MySqlDateTime

Namespace: JoeFallon\PhpTime\MySqlDateTime

Utility for producing MySQL-ready DATETIME strings (Y-m-d H:i:s) with optional microseconds.

Primary Static Methods:

Example (Production):

Example (Testing with Deterministic Provider):


Clock and DateTime Providers (Dependency Injection)

For deterministic testing, the library provides interfaces and default system implementations:

Inject custom implementations (fake clocks, controlled time sources) for predictable behavior in tests.


Testing

The project includes a PHPUnit test suite. Run tests locally:

Windows users: vendor\bin\phpunit -c phpunit.xml.dist


Contributing

Contributions are welcome. Suggested workflow:

  1. Fork the repository
  2. Create a feature branch
  3. Add tests covering new or changed behavior
  4. Run the test suite and ensure all tests pass
  5. Open a pull request with a clear description

Coding Guidelines:


Changelog & Compatibility


License

MIT License — see the LICENSE file for details


Support & Contact

If you encounter bugs or want enhancements, open an issue on the project repository. The test suite contains usage examples and edge-case handling.

Enjoy, and thanks for using phptime! — Joe Fallon


All versions of phptime with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package joefallon/phptime contains the following files

Loading the files please wait ...