Download the PHP package alameda-red/datetime without Composer

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

Alameda DateTime component

This component provides a tool-kit to work with PHPs' Date and Time related objects.

Installation

You can either modify your composer.json with

or run:

Usage

Let's start with a warning right away: working with \DateIntervals is not trivial! There is obviously a certain extend boundary in which you can pretty much do anything. As soon as you leave the box you are on your own and there is actually no tool to help you from that point on. This component won't be able to help you either.

When you base your code on working with the values for seconds, minutes, hours and days you are on the safe-side in most cases when working in a narrow timeframe. If you use DateInterval::shorten($interval, true) be sure you understand what this value will represent. An hourly representation (2nd parameter = true) of a leap-year will yield 366 24 = 8784 hours while the year representation (2nd parameter = false default) will yield 365 24 = 8760 hours.

Divide a \DateInterval

Ever thought about splitting your \DateInterval('P1D') into two parts so you'd have \DateInterval('PT12H')? You can do that:

Create a shorter, more readable representation of \DateInterval

No idea what \DateTime('PT86400S) means? Make it more readable:

String representation of a \DateInterval

If you don't want to store your \DateInterval object in a human readable form it is probably more catchy reading 'PT24H' or 'P1D' in your database over the approach of other developers to store the value in seconds (86400):

Shorten the string by using larger time units

So \DateInterval('PT1440M') is a day, make it look like one:

Sum up \DateIntervals

Doing calculations with intervals? Struggle no more!


All versions of datetime with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
zebba/utility Version 1.*
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 alameda-red/datetime contains the following files

Loading the files please wait ....