Download the PHP package kampute/civil-date without Composer

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

Civil Date PHP Package

English | فارسی

This package handles Jalali, Gregorian, and Islamic dates with one consistent, predictable model. In the Jalali calendar, Nowruz and leap years follow the official Iranian calendar rule and the vernal equinox, not fixed approximate cycles.

Purpose

Most Jalali date libraries use repeating arithmetic cycles to decide leap years. That is fast, but it is still an approximation. In some years, a cycle can place Nowruz on a different Gregorian day than the official calendar rule.

This library derives each Jalali year from the vernal equinox in Iran civil time. If the equinox occurs before local noon, Nowruz is that civil day; otherwise, Nowruz is the next civil day. Leap years follow from the number of days between one Nowruz and the next.

Features

Installation

Install with Composer:

Quick Start

Formatting and Parsing

Formatting uses a PHP-style pattern language and can combine multiple calendars in a single output. The default locale is Persian, so Jalali output uses Persian digits and names without extra configuration.

Localization

Locale definitions are decoupled from the calendar logic. Persian is enabled by default, English and Afghan Persian (fa-AF) are also included, and you can add your own locale if your project needs different wording or another language.

Islamic Month Lengths

Islamic dates use the tabular civil calendar by default. If your application has authoritative month lengths, configure them during bootstrap before the Islamic calendar is used.

Months without an entry keep their tabular length. Configured lengths affect the boundary of later Islamic dates, so load the data once at startup.

Accuracy and Range

Jalali conversions rely on an astronomical estimate of the vernal equinox evaluated in Iran civil time. This approach is designed to match the official calendar rule across a wide historical range while remaining deterministic across different runs.

Only years whose vernal equinox falls very close to noon in Iran can be sensitive. Under the official rule, if the equinox occurs before noon, Nowruz is that same day; if it occurs at noon or later, Nowruz is the next day. As a result, if two astronomical calculations place the equinox on opposite sides of that boundary, they can produce different Nowruz dates.

The supported Jalali range is year -1622 through 2378, equivalent to 1001 BCE through 3000 CE. Please note that year zero is not defined.

Documentation

Read the full documentation and API reference at https://kampute.github.io/civil-date/.

Development

Install dependencies:

Run tests:

Run static analysis and code style checks:

Build the documentation site locally:

Then open .site/index.html.

License

MIT © Kampute


All versions of civil-date with dependencies

PHP Build Version
Package Version
Requires php Version ^8.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 kampute/civil-date contains the following files

Loading the files please wait ...