Download the PHP package lawondyss/moment-php without Composer

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

MomentPHP

MomentPHP is library for parsing, manipulating and formatting dates. It's inspired by the JavaScript library Moment.js.

License

Is freely distributable under the terms of the GPL-3 license.

Install

MomentPHP is available on Packagist, where you can get it via Composer.

File composer.json:

Run in command-line:

Parse

Now

Get the current date and time:

String

Create from a string with date time. The string are acceptable same as for function strtotime (http://www.php.net/manual/en/function.strtotime.php).

Integer

Create from a integer with timestamp. The integer is a number seconds from the Unix Epoch.

DateTime

Create from a instance of the class DateTime (http://www.php.net/manual/en/class.datetime.php):

String + Format

If the string is unrecognized or confusing, you can add its format. The format are same as for method DateTime::createFromFormat (http://www.php.net/manual/en/datetime.createfromformat.php).

The format may be a field with more formats. Then use the first acceptable format.

Set Timezone

The Timezone is set via the third parameter to the constructor. Timezone may be string from a table with supported Timezones, or instance of the class DateTimeZone (http://www.php.net/manual/en/class.datetimezone.php).

Display

For examples we have:

Format()

Return formating date time. Parameter is same as for function date (http://www.php.net/manual/en/function.date.php).

Timestamp()

Return number seconds from the Unix Epoch.

Partials from date time

diff()

Get the difference in seconds.

To get the difference in another unit of measurement, pass that measurement as the second argument. Acceptable units: sec, second, seconds, min, minute, minutes, hour, hours, day, days, month, months, year, years

By default return number rounded down. If you want the floating point number, pass TRUE as the third argument.

from()

A common way of displaying time. This is sometimes called timeago or relative time.

If you can get the value without the suffix, then set second argument as TRUE.

fromNow()

It's equal as from(), but starting time is now.

Manipulate

add()

Adds an amount of days, months, years, hours, minutes and seconds. Units is same as for method diff().

Adds instance of class DateInterval.

Adds array with parameters for loop add(). [unit => number]

sub()

It's equal as add(), bud for subtracts.

startOf()

Mutates the original moment by setting it to the start of a unit of time. Units is same as for add().

endOf()

Mutates the original moment by setting it to the end of a unit of time. Units is same as for add().

Query

isLeapYear()

Returns TRUE if that year is a leap year, and FALSE if it is not.

isDST()

Checks if the current moment is in daylight savings time.

isBefore()

Check if a moment is before another moment.

If set unit, then beginning both dates set on the unit.

isAfter()

Check if a moment is after another moment. It is the exact opposite method IsBefore().

isSame()

Check if a moment is the same as another moment.

isMomentPHP()

Check if a variable is a MomentPHP object.


All versions of moment-php with dependencies

PHP Build Version
Package Version
Requires php Version >= 5.3.0
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 lawondyss/moment-php contains the following files

Loading the files please wait ....