Download the PHP package minphp/date without Composer

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

Minphp/Date

Build Status Coverage Status

Date manipulation library.

Installation

Install via composer:

Basic Usage

Instantiation

You may optionally define custom datetime formats and from/to timezones for dates during instantiation. However, they can be defined separately when setting datetime formats.

Setting Timezones

Timezones can be set during instantiation or via ::setTimezone. Not setting a set of from/to timezones will use the system's defined timezone unless the given date contains timezone information.

Setting Datetime Formats

Date formats can be set on the object to simplify calls when formatting dates.

The following date formats are available by default, but can be overridden, or added to, using this method:

Formatting a Date

Dates can be formatted by specifying your own php date format or by using one of the predefined formats.

To format a date by specifying your own date format, use Date::format:

To format a date via a predefined format or by specifying your own date format, use Date::cast:

Formatting a date respects the set timezones:

Modifying and Formatting a Date

A date can be modified by adding/subtracting time using the strtotime-compatible Date and Time formats.

The date returned is also formatted according to Formatting a Date.

For dates that are modified such that they will cross daylight savings in either the from or to timezones, you should include a relative from timezone when you want to maintain a consistent time-of-day. This is necessary if your from timezone differs from the relative timezone of the date you are modifying across daylight savings.

Consider:

Modifying dates with respect to one timezone will maintain a consistent time-of-day despite the daylight savings offset changing.

Retrieving a Date Range

A set of months or years can be generated. The dates are created from the current server time in the defined from timezone.

Generating Months

Output:

The month range and key/value format can be specified:

Output:

Generating Years

Output:

The year key/value format can be specified:

Output:

Generating a Date Range

A date range can be generated between two given dates, and formatted according to the given formatting rules. The dates are created from the current server time in the defined from timezone.

The following date range formats are used by default, but can be overridden:

Retrieving a Unix Timestamp

A Unix Timestamp can be retrieved from a date via strtotime. However, the method considers the system's timezone--not the defined from timezone--for the timestamp conversion.


All versions of date with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
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 minphp/date contains the following files

Loading the files please wait ....