PHPackages                             smilesrg/dateperiod - 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. smilesrg/dateperiod

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

smilesrg/dateperiod
===================

Simplifying getting a first/last day of week, month, year.

010PHP

Since Mar 30Pushed 11y ago1 watchersCompare

[ Source](https://github.com/smilesrg/dateperiod)[ Packagist](https://packagist.org/packages/smilesrg/dateperiod)[ RSS](/packages/smilesrg-dateperiod/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Purpose
=======

[](#purpose)

Simplifying getting a first/last day of week, month, year.

\#Installation The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist smilesrg/dateperiod "*"

```

or add

```
"smilesrg/dateperiod": "*"

```

to the require section of your `composer.json` file.

\#Usage

There are such classes available:

- YearPEriod
- MonthPeriod
- WeekPeriod
- DayPeriod

DayPeriod is for getting the start and the end of the day. You can skip passing DateTime object to the constructor, then the current date will be taken.

```
