With Composer
$ composer require nesbot/carbon
{
"require": {
"nesbot/carbon": "^3"
}
}
<?php
require 'vendor/autoload.php';
use Carbon\Carbon;
printf("Now: %s", Carbon::now());
Without Composer
Why are you not using composer? Download the Carbon latest release and put the contents of the ZIP archive into a directory in your project. Then require the file autoload.php
to get all classes and dependencies loaded on need.
<?php
require 'path-to-Carbon-directory/autoload.php';
use Carbon\Carbon;
printf("Now: %s", Carbon::now());
Documentation
https://carbon.nesbot.com/docs
ā ļø Documentation is being updated to reflect behavior on the version 3 See the migration section listing the main differences between Carbon 2 and Carbon 3
If you see a section referring to Carbon 2 behavior outside this section or have any doubt about other documentation part, do not hesitate to open an issue to raise it.
Credits
Contributors
This project exists thanks to all the people who contribute.
Translators
Thanks to people helping us to translate Carbon in so many languages
Backers
Thank you to all our backers! š