PHPackages                             phx2600/firstfriday - 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. phx2600/firstfriday

AbandonedArchivedLibrary

phx2600/firstfriday
===================

Calculates the next, first Friday of the month.

2.0.0(8y ago)19MITPHPPHP &gt;=5.6.0

Since Sep 18Pushed 8y ago1 watchersCompare

[ Source](https://github.com/PHX2600/FirstFriday)[ Packagist](https://packagist.org/packages/phx2600/firstfriday)[ RSS](/packages/phx2600-firstfriday/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

FirstFriday.php
===============

[](#firstfridayphp)

[![Latest Stable Version](https://camo.githubusercontent.com/dd1978670f0a95af115ae414ad3271ac3329eb4df7a6879dc0bda8e895dd24d3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f504858323630302f46697273744672696461792e737667)](https://packagist.org/packages/PHX2600/FirstFriday)[![Total Downloads](https://camo.githubusercontent.com/0a37b4972c7b2a871b4655d59752b94a4d4136f42b715e835574fdd3aeebd639/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f504858323630302f46697273744672696461792e737667)](https://packagist.org/packages/PHX2600/FirstFriday)[![Author](https://camo.githubusercontent.com/31ecaaf4b83988f786a502e70dcde7438fbefb66ba43b76983c032e5810bdae3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f617574686f722d43687269732532304b616e6b69657769637a2d626c75652e737667)](https://www.ChrisKankiewicz.com)[![License](https://camo.githubusercontent.com/82da2ae37b3b382ffe8c1cec76106d44a22c921a9e99cba5e0baad72e985608f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f504858323630302f46697273744672696461792e737667)](https://packagist.org/packages/PHX2600/FirstFriday)[![Build Status](https://camo.githubusercontent.com/df0fb0b1031559f12f66591dd648b0abe8c7d371ab3d2aeea6e97868cd0d26b7/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f504858323630302f46697273744672696461792e737667)](https://travis-ci.org/PHX2600/FirstFriday)

Introduction
------------

[](#introduction)

Convinience library for calculating the first Friday of a month.

Like this project? Keep me caffeinated by [making a donation](https://paypal.me/ChrisKankiewicz).

Requirements
------------

[](#requirements)

- [PHP](https://php.net) &gt;= 5.6

Install with Composer
---------------------

[](#install-with-composer)

```
composer require phx2600/firstfriday
```

Usage
-----

[](#usage)

First, import FirstFriday:

```
use PHX2600/FirstFriday;
```

Then instantiate the class:

```
$firstFriday = new FirstFriday($timezone);
```

Where `$timezone` is a String representation of a timezone to be used for date calculations. For example `America/Phoenix`, `Antarctica/Troll` or `UTC`. See  for a full list of available timezones.

Once your class is instantiated you can get the next first Friday of the month via the `next()` method:

```
$nextFirstFriday = $firstFriday->next();
```

or the previous first Friday via the `previous()` method:

```
$previousFirstFriday = $firstfriday->previous();
```

Both the `next()` and the `previous()` methods return an instance of [Carbon](http://carbon.nesbot.com/). This makes date calculations and returning specific date information easy. For example:

**Return a pre-formatted date string:**

```
$nextFirstFriday->toDateString();           // 1975-12-25
$nextFirstFriday->toFormattedDateString();  // Dec 25, 1975
$nextFirstFriday->toDateTimeString();       // 1975-12-25 14:15:16
$nextFirstFriday->toDayDateTimeString();    // Thu, Dec 25, 1975 2:15 PM
```

**Return a custom formatted string:**

```
$nextFirstFriday->format('l jS \\of F Y h:i:s A');  // Thursday 25th of December 1975 02:15:16 PM
```

**Get the time until the next first Friday in human a human readable format:**

```
$nextFirstFriday->diffForHumans();  // Something like '1 week from now' or '1 month from now'
```

**Cabon also provides a number of convinient comparison functions, for example:**

```
// The following return boolean true or false
$firstFriday->isToday();
$firstFriday->isYesterday();
$firstFriday->isTomorrow();
$firstFriday->isFuture();
$firstFriday->isPast();
```

See the [Carbon documentation](http://carbon.nesbot.com/docs/) for more details.

---

You may also override the value used as "today" in the date calculations. This will allow you to make calculations as if today were another day. This can be accomplished by passing an instance of Carbon as the second parameter when instantiating the FirstFriday class:

```
$today = Carbon::create(2017, 7, 1, 0, 0, 0, 'America/Phoenix');
$firstFriday = new FirstFriday('America/Phoenix', $today);
```

or fluently:

```
$firstFriday = new FirstFriday('America/Phoenix');
$today = Carbon::create(2017, 7, 1, 0, 0, 0, 'America/Phoenix');

$firstFriday->overrideToday($today)->next();
```

**NOTE:** Be sure to set the timezone of the `$today` parameter to the same timezone passed to the `$timezone` argument of the FirstFriday class to ensure consistency in date calculations. Failing to do so may cause unexpected results.

Troubleshooting
---------------

[](#troubleshooting)

Please report bugs to the [GitHub Issue Tracker](https://github.com/PHX2600/FirstFriday/issues).

Copyright
---------

[](#copyright)

This project is liscensed under the [MIT License](https://github.com/PHX2600/FirstFriday/blob/master/LICENSE).

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~722 days

Total

3

Last Release

3172d ago

Major Versions

1.3.0 → 2.0.0-beta2017-07-09

PHP version history (2 changes)1.3.0PHP &gt;=5.3.0

2.0.0-betaPHP &gt;=5.6.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/53531?v=4)[Chris Kankiewicz](/maintainers/PHLAK)[@PHLAK](https://github.com/PHLAK)

---

Top Contributors

[![PHLAK](https://avatars.githubusercontent.com/u/53531?v=4)](https://github.com/PHLAK "PHLAK (38 commits)")

---

Tags

carbondatephpphp-librarytimedatefirst fridayfriday

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/phx2600-firstfriday/health.svg)

```
[![Health](https://phpackages.com/badges/phx2600-firstfriday/health.svg)](https://phpackages.com/packages/phx2600-firstfriday)
```

###  Alternatives

[jenssegers/date

A date library to help you work with dates in different languages

1.8k11.2M79](/packages/jenssegers-date)[morilog/jalali

This Package helps developers to easily work with Jalali (Shamsi or Iranian) dates in PHP applications, based on Jalali (Shamsi) DateTime class.

9201.2M45](/packages/morilog-jalali)[benhall14/php-calendar

A simple PHP class to generate calendars.

9822.6k](/packages/benhall14-php-calendar)[wilianx7/php-recurring

PHP library to make getting dates easier when working with recurring tasks.

1045.0k](/packages/wilianx7-php-recurring)[zman/zman

A Jewish date converter and helper.

186.4k](/packages/zman-zman)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
