Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 9, 2024 via composer

cakephp/chronos 3.0.4

A simple API extension for DateTime.
Package summary
Share
0
issues
1
license
1
MIT
Package created
22 Sep 2015
Version published
17 Oct 2023
Maintainers
1
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
cakephp/chronos@3.0.4
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of cakephp/chronos 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does cakephp/chronos do?

CakePHP Chronos is a PHP package that offers an API extension for DateTime. It focuses on providing immutable date and datetime objects, ensuring that these objects aren't accidentally modified thus keeping data more predictable. It is especially useful when dealing with calendar dates where time components need to always match. The time on these dates is frozen at '00:00:00' and the timezone is set to the server default. This PHP extension package is ideal for anyone dealing with dates and times in their code as it simplifies the management and manipulation of these data types.

How do you use cakephp/chronos?

To install and use CakePHP Chronos, begin by installing it with Composer using the command: composer require cakephp/chronos. After the installation, you can use Chronos in your PHP file as follows:

<?php
require 'vendor/autoload.php';

use Cake\Chronos\Chronos;

printf("Now: %s", Chronos::now());

You can use the modify function to modify dates, keeping in mind your changes should be reassigned to a variable to be saved since Chronos creates immutable objects. For example:

<?php
$date = new Chronos('2015-10-21 16:29:00');
$date = $date->modify('+2 hours');

Additionally, handling calendar dates is also simplified:

<?php
use Cake\Chronos\ChronosDate;

$today = new ChronosDate();
echo $today;
// Outputs '2015-10-21'

echo $today->modify('+3 hours');
// Outputs '2015-10-21'

Where are the cakephp/chronos docs?

The documentation for CakePHP Chronos can be found at book.cakephp.org/chronos/3/en/. This will give you a more descriptive outline of how this package functions. The API documentation is available at api.cakephp.org/chronos. These resources will help you navigate the usage and implementation of Chronos in your PHP applications.