Download the PHP package iarcadia/time without Composer

On this page you can find all versions of the php package iarcadia/time. 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 time

Time

Introduction

Time is A PHP time/duration library... again.

Currently, the library supports:

The objective of this library is first to have something not related to dates at all, then to be light and simple.

Usage

Instantiation

With the new keyword:

With the static method create:

The given arguments are the same for both methods:

The static method will be used for the rest of the readme.

Time::create($h, $i, $s, $v)

Examples

Creating a Time of 17 hours and 19 minutes:

Creating a Time of 45 minutes, 12 seconds and 476 ms:

Time::create($int_or_float)

Examples

Creating a Time of 45 minutes, 12 seconds and 476 ms:

Formating

The format() method is available to format and write your Time instance:

Also, here's the characters or groups of characters which are going to be formated:

Avoid a character to be translated by making it preceded by an antislash.

Examples

Getters & Setters

The library proposes to you two different kinds of getters, the classic ones and the total.

The classics will give you the capped int values, but the hours. Minutes won't be over 59 and milliseconds over 999.

The total getters will give you a float value.

The getters also can all be used with magic attributes.

The setters will override the current timestamp of the Time instance.

They are also available as magic attributes.

Negative times

Time instances can be negative at creation, just instantiate it with a negative timestamp.

Be aware that using Time::create() with 4 arguments will not work as intented for a negative time.

Operations

Additions and substractions are possible with this library by using Time#addX() and Time#subX() methods.

You can also do these operations with other Time instances thanks to Time#addFromTime() and Time#subFromTime().

Finally, shortcut methods exist : Time#add() and Time#sub(). These two methods accept many arguments at once, and accept integer/float values and Time object.

If 4 arguments are given, it will add/substract the same way as the instantiation with 4 arguments.

The library proposes the Time#diff() and Time::diffBetween() methods to calculate difference between to times.

This feature is quite the same as Time#sub(), the only difference is that they return a new Time instance.

Comparisons

You can compare two times by using comparison methods.


All versions of time with dependencies

PHP Build Version
Package Version
No informations.
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 iarcadia/time contains the following files

Loading the files please wait ....