Download the PHP package andhikamaheva/date without Composer

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

Date

Latest Stable Version GitHub issues GitHub license Total Downloads Build Status Donate

This date library extends Carbon with multi-language supports. Methods such as format, diffForHumans, parse, createFromFormat and the new timespan, will now be translated based on your locale.

Installation

Install using composer:

Laravel

There is a service provider included for integration with the Laravel framework. This provider will get the application locale setting and use this for translations. To register the service provider, add the following to the providers array in config/app.php:

You can also add it as a Facade in aliases array config/app.php:

Languages

This package contains language files for the following languages:

Usage

The Date class extends the Carbon methods such as format and diffForHumansn and translates them based on your locale:

The Date class also added some aliases and additional methods such as: ago which is an alias for diffForHumans, and the timespan method:

Methods such as parse and createFromFormat also support "reverse translations". When calling these methods with translated input, it will try to translate it to English before passing it to DateTime:

Carbon

Carbon is the library the Date class is based on. All of the original Carbon operations are still available, check out https://github.com/briannesbitt/Carbon for more information. Here are some of the available methods:

Creating dates

You can create Date objects just like the DateTime object (http://www.php.net/manual/en/datetime.construct.php):

You can skip the creation of a DateTimeZone object:

Create Date objects from a relative format (http://www.php.net/manual/en/datetime.formats.relative.php):

This is also available using these static methods:

Creating a Date from a timestamp:

Or from an existing date or time:

Formatting Dates

You can format a Date object like the DateTime object (http://www.php.net/manual/en/function.date.php):

The Date object can be cast to a string:

Get a human readable output (alias for diffForHumans):

Calculate a timespan:

Get years since date:

Manipulating Dates

You can manipulate by using the add and sub methods, with relative intervals (http://www.php.net/manual/en/datetime.formats.relative.php):

You can access and modify all date attributes as an object:

Contributing

You can easily add new languages by adding a new language file to the lang directory. These language entries support pluralization. By using a "pipe" character, you may separate the singular and plural forms of a string:

Some languages have a different unit translation when they are used in combination with a suffix like 'ago'. For those situations you can add additional translations by adding the suffix to the unit as a key:

There is also a generator.php script that can be used to quickly output day and month translations for a specific locale. If you want to add a new language, this can speed up the process:

NOTE! If you are adding languages, please check the rules about the capitalization of month and day names: http://meta.wikimedia.org/wiki/Capitalization_of_Wiktionary_pages#Capitalization_of_month_names

License

Laravel Date is licensed under The MIT License (MIT).


All versions of date with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
nesbot/carbon Version ^1.0
symfony/translation Version ^2.7|^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 andhikamaheva/date contains the following files

Loading the files please wait ....