Download the PHP package jpuck/carbon-console without Composer

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

Carbon Console

Convert timezones and formats with Carbon wrapped in a PHP7 command line symfony console application.

Build Status Codecov Latest Stable Version Total Downloads License

Installation

First make sure you have at least PHP 7 installed. Then, there are multiple ways to install. Choose the one best for you:

Phive

The most preferred method of installation is to use phive. This avoids dependency conflicts between tools using different versions of libraries (like Carbon or Symfony Console).

Install to some directory that's in your PATH such as ~/bin or /usr/local/bin

phive install carbon --target ~/bin

This creates phive.xml in your current directory. If you're into versioning your dotfiles, consider creating a symlink to this.

Then you'll be able to easily update when new versions are released.

phive update

Download

Download the latest phar release, set it executable, and move it to a good PATH

Here's a oneline sudo command to make it available system-wide:

curl -sSL https://github.com/jpuck/carbon-console/releases/latest | egrep -o '/jpuck/carbon-console/releases/download/[0-9\.]*/carbon-console.phar"' | head -c-2 | wget --base=https://github.com/ -i - -O carbon && chmod +x carbon && sudo mv carbon /usr/local/bin/

If you don't have sudo privileges, then you can omit the last part sudo mv carbon /usr/local/bin/ and just save it somewhere in your user's PATH such as ~/bin or simply execute it verbosely with the PHP CLI.

php carbon-console.phar

Composer

Registered on packagist for installation using composer.

composer global require jpuck/carbon-console

Make sure your PATH contains the global bin directory which you can find:

composer global config bin-dir --absolute

You can then add that location to your shell profile or rc so that it's always available. For example, if you're running Ubuntu 16.04 with bash, then this might work:

echo 'export PATH="$PATH:$HOME/.config/composer/vendor/bin"' >> ~/.bashrc

NOTE that you will probably have to contend with a dependency conflict sooner or later with each additional package you install. This is why phive is preferred.

Source

git clone https://github.com/jpuck/carbon-console.git
cd carbon-console
composer install
./bin/carbon

Usage

After installing, run the list command to see a list of commands:

carbon list

Use the help command to get help with any command's usage:

carbon help convert

The primary command is convert which defaults input time now and output timezone local.

Usage:
  convert [-o|--timezone-out [TIMEZONE-OUT]] [-f|--format-out [FORMAT-OUT]] [--] [<time-in>]...

See the documentation for a list of supported input formats for date, time, and timezones. Also see available output formats.

Examples

For the following examples, my system's local timezone is set to UTC.

When it's 8:00AM in Chicago, what time will it be here?

carbon convert 8:00AM America/Chicago
2017-02-16T14:00:00+00:00 UTC

It's 5:18PM here, so what time is it in Casey Station?

carbon convert -o Antarctica/Casey
2017-02-17T04:18:12+11:00 Antarctica/Casey

When it's 6:00PM here, what time will it be in Casey Station?

carbon convert 6:00PM -o Antarctica/Casey
2017-02-17T05:00:00+11:00 Antarctica/Casey

When it's 6:00PM in Chicago, what time will it be in Casey Station?

carbon convert 6:00PM America/Chicago -o Antarctica/Casey
2017-02-17T11:00:00+11:00 Antarctica/Casey

Let's format that output as 12-hour:minute

carbon convert 6:00PM America/Chicago -o Antarctica/Casey -f h:iA
11:00AM

If you use spaces in your format, make sure to quote the argument.

carbon convert 6:00PM America/Chicago -o Antarctica/Casey -f 'h:iA l, F j'
11:00AM Friday, February 17

All versions of carbon-console with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0
symfony/console Version ^3.2
nesbot/carbon Version ^1.22
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 jpuck/carbon-console contains the following files

Loading the files please wait ....