PHPackages                             nickmoline/laravel-stardate - 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. nickmoline/laravel-stardate

ActiveLibrary

nickmoline/laravel-stardate
===========================

A Laravel package to convert dates to stardates.

v1.0.0(2y ago)115↓33.3%GPL-3.0-or-laterPHP

Since Jul 24Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Holodeck-3/laravel-stardate)[ Packagist](https://packagist.org/packages/nickmoline/laravel-stardate)[ RSS](/packages/nickmoline-laravel-stardate/feed)WikiDiscussions main Synced 1mo ago

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

laravel-stardate
================

[](#laravel-stardate)

Carbon macros for Laravel Star Trek Date based calculations.

Stardate Calculators
--------------------

[](#stardate-calculators)

- `Carbon::actdStardate()` converts carbon dates into pseudo-stardates as used in the ST:ACTD Role playing game and defined in [their player's handbook](http://startrek.acalltoduty.com/wiki/index.php/All_Division_Player_Handbook#Stardate_Format)
- `Carbon::tngStardate(int $precision = 1) : string` formats Carbon dates into TNG stardates using the formula[reverse engineered by trekguide.com](http://trekguide.com/Stardates.htm#TNG). You can pass an integer in the parenthesis to adjust the decimal precision (default is 1 digit)
- `Carbon::createFromStardate(float|string $stardate) : Carbon` creates a carbon instance from a given stardate (allowing you to convert it back into corresponding earth dates)
- `Carbon::contemporaryStardate(int $precision = 1) : string` formats Carbon dates into TNG stardates using the same formula as `Carbon::tngStardate()` but first adds 331 years. This way dates in 1987 appear as if they were in the year 2363 (allowing dates contemporary with TNG era series airing to roughly coincide with the corresponding stardates in the show). Somewhat necessary for dates before 2318 which would calculate to negative stargates.

Star Trek Holidays
------------------

[](#star-trek-holidays)

Inspired by [dansoppelsa/laravel-carbon-macros](https://packagist.org/packages/dansoppelsa/laravel-carbon-macros) several functions have been added for Star Trek specific holidays.

- **is*HolidayName*()** function returning true if it is a given holiday or not
- **next*HolidayName*()** function returning a `Carbon` date of the next instance of the given holiday after the current date object
- **last*HolidayName*()** function returning a `Carbon` date of the previous instance of a given holiday before the current date object
- **until*HolidayName*()** function returning a `CarbonInterval` representing the time until the next instance of a given holiday after the current date object.
- **since*HolidayName*()** function returning a `CarbonInterval` representing the time since the last instance of a given holiday before the current date object.

There is also a generic **trekHoliday** macro that returns the string name of the current holiday if it *is* a holiday and an **isTrekHoliday** that returns true if the current date object is *any* of those holidays.

### Current Available Holidays

[](#current-available-holidays)

- **First Contact Day**: [April 5](https://memory-alpha.fandom.com/wiki/First_Contact_Day)
- **Star Trek Day**: [September 8](https://www.daysoftheyear.com/days/star-trek-day/), the anniversary of the first airing of Star Trek, CBS/Paramount+ often makes a big deal out of this day
- **Captain Picard Day**: [June 16](https://memory-alpha.fandom.com/wiki/Captain_Picard_Day)
- **Frontier Day**: [April 14](https://www.startrek.com/news/what-is-frontier-day).
    - This was tricky, we know it is in April, and that it celebrates the launching of the NX-01. The specific date we get in Broken Bow is April 16, but the launch was at least a day earlier based on the position of that. Startrek.com [mentioned](https://www.startrek.com/news/what-is-frontier-day) it with a post on April 14th, so we went with that date.
- **Ancestor's Eve**: [April 22](https://memory-alpha.fandom.com/wiki/Ancestors%27_Eve)

### Holiday Example

[](#holiday-example)

```
$date = Carbon::parse("April 5, 2023");
$date->isFirstContactDay(); # true
$date->isStarTrekDay(); # false
$date->nextAncestorsEve(); # "April 22, 2023"
$date->untilNextAncestorsEve(); # "17 days"
$date->trekHoliday(); # "First Contact Day"
$date->isTrekHoliday(); # true

$date->addDays(2);
$date->trekHoliday(); # null
$date->isTrekHoliday(); # false
$date->sinceFirstContactDay(); # "2 days"
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

1023d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f8e9905a625d55953fa99dc7fa2594965f90bc84bb02ac979c039faead324f31?d=identicon)[nickmoline](/maintainers/nickmoline)

---

Top Contributors

[![nickmoline](https://avatars.githubusercontent.com/u/1545057?v=4)](https://github.com/nickmoline "nickmoline (7 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nickmoline-laravel-stardate/health.svg)

```
[![Health](https://phpackages.com/badges/nickmoline-laravel-stardate/health.svg)](https://phpackages.com/packages/nickmoline-laravel-stardate)
```

###  Alternatives

[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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