PHPackages                             icanboogie/datetime - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. icanboogie/datetime

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

icanboogie/datetime
===================

Extends the features of PHP DateTime and DateTimeZone

v3.0.0(11mo ago)51345.7k↓33.7%73BSD-3-ClausePHPPHP &gt;=8.2CI passing

Since Mar 7Pushed 11mo ago3 watchersCompare

[ Source](https://github.com/ICanBoogie/DateTime)[ Packagist](https://packagist.org/packages/icanboogie/datetime)[ Docs](https://icanboogie.org/)[ RSS](/packages/icanboogie-datetime/feed)WikiDiscussions 3.0 Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (18)Used By (3)

DateTime
========

[](#datetime)

[![Release](https://camo.githubusercontent.com/2b61f4421376fda408c43c33e220e75005feeca1f83ab8c98f15996928534135/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f4943616e426f6f6769652f4461746554696d652e737667)](https://packagist.org/packages/icanboogie/datetime)[![Code Coverage](https://camo.githubusercontent.com/b2494a2b5d501e2368ca6f3f0a1e43129253aa41a6b41d6dd8c62d9aaa22c499/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4943616e426f6f6769652f4461746554696d652f62616467652e7376673f6272616e63683d332e30)](https://coveralls.io/github/ICanBoogie/DateTime?branch=3.0)[![Downloads](https://camo.githubusercontent.com/ab033ef926449896b886d145c30362bd17175df8e7696137356bf2606947e441/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6963616e626f6f6769652f6461746574696d652e737667)](https://packagist.org/packages/icanboogie/datetime)

This package extends the features of PHP [DateTime](http://www.php.net/manual/en/class.datetime.php)and [DateTimeZone](http://www.php.net/manual/en/class.datetimezone.php) classes to ease the handling of times, time zones, and time zone locations. Getting the UTC or local representation of a time, formatting the time to a predefined format, accessing common properties such as day, month, year, quarter, and more has been made especially easy. Also, all instances can be used as strings.

#### Installation

[](#installation)

```
composer require icanboogie/datetime
```

### Usage

[](#usage)

Let's say that *now* is "2013-02-03 21:03:45" in Paris:

```
