Download the PHP package fyre/datetime without Composer

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

FyreDateTime

FyreDateTime is a free, open-source immutable date manipulation library for PHP.

It is a modern library, and features support for ICU formats, time zones and locales.

Table Of Contents

Installation

Using Composer

In PHP:

Basic Usage

Date Creation

From Array

The month and date in the $dateArray will default to 1 if not set. The hours, minutes, seconds and milliseconds will default to 0.

From DateTime

From Format

The $formatString supports tokens described in the ICU specification.

From ISO String

From Timestamp

Now

Date Formatting

Format

Once you have created a DateTime object, you can get a string representation using a specific format with the format method.

The $formatString supports tokens described in the ICU specification.

To String

Format the current date using "eee MMM dd yyyy HH:mm:ss xx (VV)".

To Date String

Format the current date using "eee MMM dd yyyy".

To ISO String

Format the current date using "yyyy-MM-dd'T'HH:mm:ss.SSSxxx" (in English and UTC time zone).

To Time String

Format the current date using "HH:mm:ss xx (VV)".

To UTC String

Format the current date using "eee MMM dd yyyy HH:mm:ss xx (VV)" (in UTC time zone).

Date Attributes

Get Date

Get the date in current time zone.

Get Day

Get the day of the week in current time zone.

The $day returned will be between 0 (Sunday) and 6 (Saturday).

Get Day Of Year

Get the day of the year in current time zone.

The $dayOfYear returned will be between 0 and 365.

Get Month

Get the month in current time zone.

The $month returned will be between 1 (January) and 12 (December).

Get Quarter

Get the quarter of the year in current time zone.

The $quarter returned will be between 1 and 4.

Get Year

Get the year in current time zone.

Set Date

Set the date in current time zone.

Set Day

Set the day of the week in current time zone.

Set Day Of Year

Set the day of the year in current time zone.

Set Month

Set the month in current time zone.

If the $date argument is omitted, and the new month contains less days than the current date, the date will be set to the last day of the new month.

To disable date clamping, use the method DateTime::setDateClamping() using false as the argument.

Set Quarter

Set the quarter of the year in current time zone.

Set Year

Set the year in current time zone.

If the $date argument is omitted, and the new month contains less days than the current date, the date will be set to the last day of the new month.

To disable date clamping, use the method DateTime::setDateClamping() using false as the argument.

Week Attributes

Get Week

Get the week of the year in current time zone.

The $week returned will be between 1 and 53 (week starting on Monday).

Get Week Day

Get the local day of the week in current time zone.

The $weekDay returned will be between 1 and 7.

Get Week Day In Month

Get the day of the week in the month, in current time zone.

The $weekDayInMonth returned will be between 1 and 5.

Get Week Of Month

Get the week of the month in current time zone.

The $weekOfMonth returned will be between 1 and 5.

Get Week Year

Get the week year in current time zone.

This method is identical to getYear() except in cases where the week belongs to the previous or next year, then that value will be used instead.

Set Week

Set the week in current time zone.

Set Week Day

Set the local day of the week in current time zone.

Set Week Day In Month

Set the day of the week in the month, in current time zone.

Set Week Of Month

Set the week of the month in current time zone.

Set Week Year

Set the week year in current time zone.

Time Attributes

Get Hours

Get the hours of the day in current time zone.

The $hours returned will be between 0 and 23.

Get Milliseconds

Get the milliseconds of the second in current time zone.

The $milliseconds returned will be between 0 and 999.

Get Minutes

Get the minutes of the hour in current time zone.

The $minutes returned will be between 0 and 59.

Get Seconds

Get the seconds of the minute in current time zone.

The $seconds returned will be between 0 and 59.

Set Hours

Set the hours of the day in current time zone.

Set Milliseconds

Set the milliseconds of the second in current time zone.

Set Minutes

Set the minutes of the hour in current time zone.

Set Seconds

Set the seconds of the minute in current time zone.

Timestamps

Get Milliseconds

Get the number of milliseconds since the UNIX epoch.

Get Seconds

Get the number of seconds since the UNIX epoch.

Set Milliseconds

Set the number of milliseconds since the UNIX epoch.

Set Seconds

Set the number of seconds since the UNIX epoch.

Time Zones

Get Time Zone

Get the name of the current time zone.

Get Time Zone Offset

Get the UTC offset (in minutes) of the current time zone.

Set Time Zone

Set the current time zone.

Set Time Zone Offset

Set the UTC offset (in minutes).

Locales

Get Locale

Get the name of the current locale.

Set Locale

Set the current locale.

Manipulation

Add Day

Add a day to the current date.

Add Days

Add days to the current date.

Add Hour

Add a hour to the current date.

Add Hours

Add hours to the current date.

Add Minute

Add a minute to the current date.

Add Minutes

Add minutes to the current date.

Add Month

Add a month to the current date.

Add Months

Add months to the current date.

Add Second

Add a second to the current date.

Add Seconds

Add seconds to the current date.

Add Week

Add a week to the current date.

Add Weeks

Add weeks to the current date.

Add Year

Add a year to the current date.

Add Years

Add years to the current date.

End Of Day

Set the date to the end of the day in current time zone.

End Of Hour

Set the date to the end of the hour in current time zone.

End Of Minute

Set the date to the end of the minute in current time zone.

End Of Month

Set the date to the end of the month in current time zone.

End Of Quarter

Set the date to the end of the quarter in current time zone.

End Of Second

Set the date to the end of the second in current time zone.

End Of Week

Set the date to the end of the week in current time zone.

End Of Year

Set the date to the end of the year in current time zone.

Start Of Day

Set the date to the start of the day in current time zone.

Start Of Hour

Set the date to the start of the hour in current time zone.

Start Of Minute

Set the date to the start of the minute in current time zone.

Start Of Month

Set the date to the start of the month in current time zone.

Start Of Quarter

Set the date to the start of the quarter in current time zone.

Start Of Second

Set the date to the start of the second in current time zone.

Start Of Week

Set the date to the start of the week in current time zone.

Start Of Year

Set the date to the start of the year in current time zone.

Subtract Day

Subtract a day to the current date.

Subtract Days

Subtract days to the current date.

Subtract Hour

Subtract a hour to the current date.

Subtract Hours

Subtract hours to the current date.

Subtract Minute

Subtract a minute to the current date.

Subtract Minutes

Subtract minutes to the current date.

Subtract Month

Subtract a month to the current date.

Subtract Months

Subtract months to the current date.

Subtract Second

Subtract a second to the current date.

Subtract Seconds

Subtract seconds to the current date.

Subtract Week

Subtract a week to the current date.

Subtract Weeks

Subtract weeks to the current date.

Subtract Year

Subtract a year to the current date.

Subtract Years

Subtract years to the current date.

Comparisons

Difference

Get the difference between two dates in milliseconds.

Difference In Days

Get the difference between two dates in days.

If $relative is true (default) the value returned will be the relative difference, ignoring higher precision properties.

Difference In Hours

Get the difference between two dates in hours.

If $relative is true (default) the value returned will be the relative difference, ignoring higher precision properties.

Difference In Minutes

Get the difference between two dates in minutes.

If $relative is true (default) the value returned will be the relative difference, ignoring higher precision properties.

Difference In Months

Get the difference between two dates in months.

If $relative is true (default) the value returned will be the relative difference, ignoring higher precision properties.

Difference In Seconds

Get the difference between two dates in seconds.

If $relative is true (default) the value returned will be the relative difference, ignoring higher precision properties.

Difference In Weeks

Get the difference between two dates in weeks.

If $relative is true (default) the value returned will be the relative difference, ignoring higher precision properties.

Difference In Years

Get the difference between two dates in years.

If $relative is true (default) the value returned will be the relative difference, ignoring higher precision properties.

Is After?

Determine whether the DateTime is after another date.

Is After Day?

Determine whether the DateTime is after another date (comparing by day).

Is After Hour?

Determine whether the DateTime is after another date (comparing by hour).

Is After Minute?

Determine whether the DateTime is after another date (comparing by minute).

Is After Month?

Determine whether the DateTime is after another date (comparing by month).

Is After Second?

Determine whether the DateTime is after another date (comparing by second).

Is After Week?

Determine whether the DateTime is after another date (comparing by week).

Is After Year?

Determine whether the DateTime is after another date (comparing by year).

Is Before?

Determine whether the DateTime is before another date.

Is Before Day?

Determine whether the DateTime is before another date (comparing by day).

Is Before Hour?

Determine whether the DateTime is before another date (comparing by hour).

Is Before Minute?

Determine whether the DateTime is before another date (comparing by minute).

Is Before Month?

Determine whether the DateTime is before another date (comparing by month).

Is Before Second?

Determine whether the DateTime is before another date (comparing by second).

Is Before Week?

Determine whether the DateTime is before another date (comparing by week).

Is Before Year?

Determine whether the DateTime is before another date (comparing by year).

Is Between?

Determine whether the DateTime is between two other dates.

Is Between Day?

Determine whether the DateTime is between two other dates (comparing by day).

Is Between Hour?

Determine whether the DateTime is between two other dates (comparing by hour).

Is Between Minute?

Determine whether the DateTime is between two other dates (comparing by minute).

Is Between Month?

Determine whether the DateTime is between two other dates (comparing by month).

Is Between Second?

Determine whether the DateTime is between two other dates (comparing by second).

Is Between Week?

Determine whether the DateTime is between two other dates (comparing by week).

Is Between Year?

Determine whether the DateTime is between two other dates (comparing by year).

Is Same?

Determine whether the DateTime is the same as another date.

Is Same Day?

Determine whether the DateTime is the same as another date (comparing by day).

Is Same Hour?

Determine whether the DateTime is the same as another date (comparing by hour).

Is Same Minute?

Determine whether the DateTime is the same as another date (comparing by minute).

Is Same Month?

Determine whether the DateTime is the same as another date (comparing by month).

Is Same Second?

Determine whether the DateTime is the same as another date (comparing by second).

Is Same Week?

Determine whether the DateTime is the same as another date (comparing by week).

Is Same Year?

Determine whether the DateTime is the same as another date (comparing by year).

Is Same Or After?

Determine whether the DateTime is the same as or after another date.

Is Same Or After Day?

Determine whether the DateTime is the same as or after another date (comparing by day).

Is Same Or After Hour?

Determine whether the DateTime is the same as or after another date (comparing by hour).

Is Same Or After Minute?

Determine whether the DateTime is the same as or after another date (comparing by minute).

Is Same Or After Month?

Determine whether the DateTime is the same as or after another date (comparing by month).

Is Same Or After Second?

Determine whether the DateTime is the same as or after another date (comparing by second).

Is Same Or After Week?

Determine whether the DateTime is the same as or after another date (comparing by week).

Is Same Or After Year?

Determine whether the DateTime is the same as or after another date (comparing by year).

Is Same Or Before?

Determine whether the DateTime is the same as or before another date.

Is Same Or Before Day?

Determine whether the DateTime is the same as or before another date (comparing by day).

Is Same Or Before Hour?

Determine whether the DateTime is the same as or before another date (comparing by hour).

Is Same Or Before Minute?

Determine whether the DateTime is the same as or before another date (comparing by minute).

Is Same Or Before Month?

Determine whether the DateTime is the same as or before another date (comparing by month).

Is Same Or Before Second?

Determine whether the DateTime is the same as or before another date (comparing by second).

Is Same Or Before Week?

Determine whether the DateTime is the same as or before another date (comparing by week).

Is Same Or Before Year?

Determine whether the DateTime is the same as or before another date (comparing by year).

Utility Methods

Day Name

Get the name of the day of the week in current time zone and locale.

Day Period

Get the day period in current time zone and locale.

Days In Month

Get the number of days in the current month.

Days In Year

Get the number of days in the current year.

Era

Get the era in current time zone and locale.

Is DST?

Determine whether the DateTime is in daylight savings.

Is Leap Year?

Determine whether the year is a leap year.

Month Name

Get the name of the month in current time zone and locale.

Time Zone Name

Get the name of the current time zone and locale.

Weeks In Year

Get the number of weeks in the current year.

Static Methods

Get Default Locale

Get the default locale.

Get Default Time Zone

Get the default time zone.

Set Date Clamping

Set whether dates will be clamped when changing months.

Set Default Locale

Set the default locale.

Set Default Time Zone

Set the default time zone.


All versions of datetime 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 fyre/datetime contains the following files

Loading the files please wait ....