Download the PHP package jobmetric/multi-calendar without Composer

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

Contributors Forks Stargazers MIT License LinkedIn

Multi Calendar for PHP

Multi-Calendar is a PHP library for converting dates between multiple calendar systems, including Gregorian, Jalali (Persian), Hijri (Islamic), Hebrew, Buddhist, Coptic, Ethiopian, and Chinese. It provides an easy-to-use API with support for both array and formatted string outputs, making date conversions reliable and consistent across different calendar types.

Install via composer

Run the following command to pull in the latest version:

Documentation

Basic Usage

Supported Calendars

This library supports the following calendar systems, each with its own converter class. You can instantiate these classes and use their methods to convert dates between the Gregorian calendar and the respective calendar system.

Calendar Key Class Name Description
gregorian GregorianConverter (default) The standard calendar used worldwide.
jalali (Persian) JalaliConverter The Iranian calendar, also known as the Solar Hijri calendar.
hijri (Islamic) HijriConverter The lunar calendar used in the Islamic world.
hebrew HebrewConverter The calendar used in Jewish culture.
buddhist BuddhistConverter The calendar used in many Buddhist countries.
coptic CopticConverter The calendar used in the Coptic Orthodox Church.
ethiopian EthiopianConverter The calendar used in Ethiopia.
chinese ChineseConverter The traditional Chinese calendar.

Using the Factory

You can also use the CalendarConverterFactory to create converters dynamically based on the calendar key:

Number Transliteration

You can convert numbers between English, Persian, and Arabic numeral systems:

Output Format

Array output: default when $mod (separator) is empty Example: [2025, 8, 13]

String output: set $mod to a separator (/, -, .) Example: "2025/08/13"

Example Conversion Table for 2025-08-13 (Gregorian)

Calendar Date
Gregorian 2025-08-13
Jalali 1404-05-22
Hijri 1447-02-20
Hebrew 5785-12-19
Buddhist 2568-08-13
Coptic 1741-12-07
Ethiopian 2017-12-07
Chinese 2025-07-11

Note: Values for non-Gregorian calendars are calculated using the intl extension. Actual results may vary slightly based on leap year and leap month handling.

Command Line Tool

The package includes a command-line tool (date-converter.sh) that allows you to convert dates between different calendar systems directly from your terminal without writing PHP code.

Usage

You can use the command-line tool in two ways:

Direct execution:

Using Composer alias:

Note: When using the Composer alias, use -- to separate Composer arguments from the script arguments.

Arguments

Argument Description
date Optional. If not provided, current date (now) will be used.

Options

Option Short Description Default
--date-format -df Input calendar type (supported calendar systems) gregorian
--to -t Output calendar type (supported calendar systems) gregorian
--format-input -fi Input date string format (supported date formats), auto-detected if not provided Auto-detect
--format-output -fo Output date format (supported date formats) Y-m-d
--timezone -tz Convert time to specified timezone (e.g., Asia/Tehran, UTC, Europe/London) None
--from-timezone -ftz Source timezone for time conversion (e.g., UTC, Europe/London) Auto-detect
--to-timezone -ttz Target timezone for time conversion (e.g., Asia/Tehran, UTC) None
--help -h Show this help message -

Supported Calendar Systems

Supported Date Formats

Timezone Conversion

The command-line tool supports timezone conversion in two ways:

  1. Simple timezone conversion (using --timezone for backward compatibility):

    • Converts the input time to the specified timezone
    • Automatically detects the source timezone from the input date or uses default based on calendar type
  2. Explicit timezone conversion (using --from-timezone and --to-timezone):
    • Allows you to explicitly specify both source and target timezones
    • More precise control over timezone conversion
    • Automatically adds time to output format if timezone conversion is performed

Important Notes:

Timezone Conversion Examples:

Examples

Direct execution:

Using Composer alias:

License

The MIT License (MIT). Please see License File for more information.

Contributing

Thank you for considering contributing to the Laravel Multi Calendar! The contribution guide can be found in the CONTRIBUTING.md.


All versions of multi-calendar with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
ext-intl Version *
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 jobmetric/multi-calendar contains the following files

Loading the files please wait ...