Download the PHP package damenjo/rutin without Composer

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

Rutin Provide Great PHP API Extension For DateTime Services :+1:

Installation List

You can install this package via:

Dependency Manager Command
Composer

Guidelines

You may get the current date and time just only using our now() method. Here's the example below:

By default, our package will recognized this DateTime format as Y-m-d H:i:s . If you need to define the specific timezone as well, you can set the first argument directly to the now() method like this:

If you need to specified another DateTime format, you may also set the first argument for format() method. Here's the way to do that:

Note: All DateTime keyword format was referred to PHP DateTime Format documentations.

We also have method that can help you to add or substract days, month, year, etc as many as you want. The list of utilities that you can use will be described below:

Method Name Used For
addDay() Add one day to your specific DateTime
subDay() Substract one day to your specific DateTime
addDays(int $numberOfDays) Add N days to your specific DateTime
addDayIf(callable $prediction) Add one day to your specific DateTime with certain condition
subDayIf(callable $prediction) Substract one day to your specific DateTime with certain condition
addDaysIf(callable $prediction, int $numberOfDays) Add N days to your specific DateTime with certain condition
addMonth() Add one month to your specific DateTime
addMonths(int $numberOfMonths) Add N months to your specific DateTime
addMonthIf(callable $prediction) Add one month to your specific DateTime with certain condition
addMonthsIf(callable $prediction, int $numberOfMonths) Add N months to your specific DateTime with certain condition
addYear() Add one year to your specific DateTime
addYears(int $numberOfYears) Add N years to your specific DateTime
addYearIf(callable $prediction) Add one year to your specific DateTime with certain condition
addYearsIf(callable $prediction, int $numberOfYears) Add N years to your specific DateTime with certain condition
addTimestamp(int $numberOfTimestamp = 1) Add defined number of timestamp to your specific DateTime
addTimestampIf(callable $prediction, int $numberOfTimestamp = 1) Add defined number of timestamp to your specific DateTime with certain condition

[!NOTE] We also now have add(string $dateElement, int $numberOfDateElement = 1) or skip(string $dateElement, int $numberOfDateElement = 1) to make your life easier. We'll describe the example below the existing code, so please take your time to see it ^_^

This is a few example how to use all the listed method above:

[!WARNING] null or any type unless number will cause an error, so please take a note that try and catch blocks are important to handle the error of your code. For some quick step, lets see this code:

Also, if you have scenario like to add your day by some conditions, you can use addDayIf() .

Certainly, there is a scenario that make you need to use condition within the add() method. That is now possible to do with our brand new while() .

Since this method was calling in front of addition or substraction method like addDay() or addMonths() , etc , this awesome while() method will determine that addition or substraction functionality will be affected to the current DateTime or not.

[!WARNING] while() only will affect to addition or substraction datetime method, not another things like format()


License: MIT


All versions of rutin with dependencies

PHP Build Version
Package Version
No informations.
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 damenjo/rutin contains the following files

Loading the files please wait ....