Download the PHP package rxante/dateimmutable without Composer

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

PHPDateImmutable

This is an implementation of a DateImmutable class that deals only with dates and not with time. PHP has, of course, built-in, DateTime and DateTimeImmutable classes. We have found that we frequently want a class that deals only with the date.

This DateImmutable class implements all the same methods that PHP's DateTimeImmutable does, and in the same way, except where the method wouldn't make sense for a class that does not deal with time.

Methods

The Constructor

DateImmutable's constructor works exactly the same way as DateTimeImmutable's does, except that it does not accept a DateTimeZone as a second argument because timezones do not matter when you're not dealing with time.

diff (instance method)

Returns the difference between its own instance, and another instance of either DateImmutable or the DateTimeInterface

format (instance method)

Takes all the same options that PHP's DateTimeInterface does: https://www.php.net/manual/en/datetime.format.php

If any time formatting tokens are used, 0s will always be returned since there is no time on the DateImmutable class.

getTimestamp (instance method)

Gets the unix timestamp of UTC midnight for the given date.

add (instance method)

Adds an amount of days, months, and years to the existing instance's value, and returns a new instance with the new values.

Any hours, minutes, or seconds on the DateInterval argument input will be ignored.

createFromFormat (static method)

Returns new DateImmutable object formatted according to the specified format.

Takes all the same options that PHP's DateTimeImmutable does: https://www.php.net/manual/en/datetime.format.php

modify (instance method)

Creates a new instance of DateImmutable modified by the input.

Takes all the same options that PHP's DateTime classes do: https://www.php.net/manual/en/datetime.formats.php

setDate (instance method)

Sets the date to the input year/month/day and returns a new instance of the class with that value.

setISODate (instance method)

Sets the date to the input year/week/dayOfWeek and returns a new instance of the class with that value.

sub (instance method)

Subtracts an amount of days, months, and years from the existing instance's value, and returns a new instance with the new values.

Any hours, minutes, or seconds on the DateInterval argument input will be ignored.


All versions of dateimmutable with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
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 rxante/dateimmutable contains the following files

Loading the files please wait ...