Download the PHP package brekitomasson/seconds without Composer

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

Seconds

PHP Library to simplify stuff when all you want is a number of seconds.

Will be kept super simple as it's mainly just a single Enum class with a bunch of constants and helper functions that all return an integer. Don't expect too many new features in upcoming patches and updates, since it's just a simple helper library that does one thing and one thing only.

Usage

Usage is super simple, as one would expect. Just call the static method for the appropriate input type and give it the number, and it will return the number of seconds. No more 60 * 60 * 24 * 7 to get the number of seconds in a week. Just call Seconds::weeks(1) and you're good to go.

For example:

Limitations and Constraints

Since I want to keep things simple, the output is limited to positive numbers. This means that even if the input is negative, the output will be positive:

Also, the input for all methods must be a whole number, so you cannot check how many seconds are in 3.5 hours unless you do something like this:

Finally, the longest available time period is weeks, since both months and years have a variable length. If you want to figure out how many seconds are in three months, you'll have to do something like one of these examples:

Upcoming Features and Future Development Ideas

Right now, I have very little planned for this library as it does what it's supposed to do. The only thing that I can imagine is maybe adding support for calculating the seconds between two dates, but that's not really the purpose of this library. If you want to do that, you should probably use the Carbon library and do something like this:

Of course, if you have any thoughts or ideas, feel free to open an issue or throw a Pull Request my way, and we'll see what comes of it!


All versions of seconds with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
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 brekitomasson/seconds contains the following files

Loading the files please wait ....