effectra / clock
The Effectra Clock package.
Installs: 26
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/effectra/clock
Requires
- php: ^8.0.2
- psr/clock: ^1.0
README
This is a PHP class named Effectra\Clock that implements the Psr\Clock\Clock interface. It provides a simple and standard way to retrieve the current time and timestamp in PHP applications.
Features
- Implements the
Psr\Clock\ClockInterfaceinterface - Provides the
now()method to retrieve the current time as aDateTimeImmutableobject - Offers the
timestamp()method to retrieve the current timestamp as an integer
Usage
// Create a new instance of the Clock class $clock = new \Effectra\Clock\Clock(); // Get the current time as a DateTimeImmutable object $currentDateTime = $clock->now(); // Get the current timestamp as an integer $currentTimestamp = $clock->timestamp();
Contributing
Contributions are welcome! If you encounter any issues or have suggestions for improvements, please feel free to submit a pull request or open an issue on the GitHub repository.
License
This package is open-source and available under the MIT License. "# clock"