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.
Download joefallon/phptime
More information about joefallon/phptime
Files in joefallon/phptime
Package phptime
Short Description This package contains a set of classes for making it easier to work with time in PHP.
License MIT
Homepage https://github.com/joefallon/phptime
Informations about the package phptime
phptime
By Joe Fallon
Joe's PHP Time Utilities is a set of classes useful for assisting with working with time related values in PHP and MySQL. It is important to note that this is not an all inclusive date and time solution. Currently, it provides the following capabilities:
- A millisecond resolution chronograph is provided to easily measure the elapsed time between two events.
- A class containing a collection of constants representing every day of the week is provided.
- A class containing a collection of constants representing every month of the year is provided.
- A class containing a method for getting a time stamp that is suitable
for immediate insertion into MySQL (i.e.
Y-m-d H:i:s
) is provided.
Installation
The easiest way to install Joe's PHP Time Utilities is with
Composer. Create the following composer.json
file
and run the php composer.phar install
command to install it.
Class Documentation
Chronograph
Here is an example of using Chronograph
to measure the time elapsed in
milliSeconds between a start time and stop time:
Here is an example of using Chronograph
to measure the time elapsed in
seconds between a start time and stop time:
Days
Here is the contents of the Days
class:
Months
Here is the contents of the Months
class:
MySqlDateTime
Here is an example of using MySqlDateTime
to get a time-stamp suitable for
immediate insertion into MySQL: