Download the PHP package matt-harvey/civil-date-time without Composer

On this page you can find all versions of the php package matt-harvey/civil-date-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 civil-date-time

civil-date-time

Github actions Build Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

a civil date and time library for PHP

Motivation

A civil date, or civil time, is a date/time without any timezone specified.

Such an entity should not be used for representing a precise, absolute moment or period in time. However, it is a good way to represent the concept of a "calendar date" or "clock time" as it is used in many everyday contexts.

For example, if someone was born on 1 January 2000, then they will typically want to celebrate their birthday on 1 January each year, in whichever timezone they happen to be living in at the time. In other words, the entity "1 January 2000", insofar as it represents their date of birth, is timezone-agnostic.

In a software context, this might be important if, for example, we want to send an email to each user on their birthday, where each user may have a different timezone associated with them. A given user's timezone might change over time; but their date of birth will not. It is with the user that the timezone should be associated here—not with their date of birth.

While it's possible to use the standard library's DateTime or DateTimeImmutable to represent civil dates and times in PHP, it isn't ideal, as it requires an out-of-band convention about how to interpret the timezone information attached to such an object. (Should the timezone data merely be ignored? Should the date time be converted to UTC and then have its timezone ignored? Or should non-UTC DateTimes be considered invalid as representations of civil dates?)

A dedicated class, that omits timezone information by design, allows civil dates, times, and date-time pairings, to be represented cleanly and directly.

For additional concrete use cases for civil dates, times, and date-times, see this comment in relation to a similar library proposed for Go.

Installation

Note this library is still in a pre-v1 state, and there may be breaking changes in any release. (Although, I will generally avoid making breaking changes in patch version releases.)

Usage

There are three classes offered:

Each of these is immutable: methods such as CivilDate::addDays() always return new instances, rather than mutating the existing one.

Civil dates

Civil times

Civil date/times

Civil date/time in other PHP libraries

Civil date/time libraries in other programming languages

Contributing

PRs, bug reports, and suggestions are all welcome. Please ensure unit test coverage is maintained.

You will need xdebug installed to generate the coverage report.

composer test runs the test suite.


All versions of civil-date-time with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1.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 matt-harvey/civil-date-time contains the following files

Loading the files please wait ....