PHPackages                             ddate/ddate - 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. ddate/ddate

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

ddate/ddate
===========

Ddate converts Gregorian to Discordian dates.

v1.1.1(5y ago)8275[1 PRs](https://github.com/dweichert/Ddate/pulls)UnlicensePHP &gt;=5.3.0

Since Oct 31Compare

[ Source](https://github.com/dweichert/Ddate)[ Packagist](https://packagist.org/packages/ddate/ddate)[ RSS](/packages/ddate-ddate/feed)WikiDiscussions Synced 6d ago

READMEChangelog (10)Dependencies (1)Versions (16)Used By (0)

README
======

[](#readme)

[![Build Status](https://camo.githubusercontent.com/5aead32d2fea902692cd6c91178e70f59fd2d7f572749496e5a405055bb40bf4/68747470733a2f2f7472617669732d63692e6f72672f6477656963686572742f44646174652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/dweichert/Ddate)[![Downloads this Month](https://camo.githubusercontent.com/497dd9de4c0a1cd2fb6f11664395a0885feaca882dce8072cfd14ddcdafc2351/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f64646174652f64646174652e7376673f7374796c653d666c6174)](https://packagist.org/packages/ddate/ddate)[![Latest stable](https://camo.githubusercontent.com/9a0e78d6f9d9e9d69519861f999fce0c25776963dba3b2f30f2e431197fba869/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64646174652f64646174652e7376673f7374796c653d666c6174266c6162656c3d737461626c65)](https://packagist.org/packages/ddate/ddate)[![Latest dev](https://camo.githubusercontent.com/04af5bb4756294e45e5c1b09a94aafa756004f37f3fa1ae9bca656cf8e257911/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f767072652f64646174652f64646174652e7376673f7374796c653d666c6174266c6162656c3d756e737461626c65)](https://packagist.org/packages/ddate/ddate)[![License](https://camo.githubusercontent.com/01aeaf04bfc208271700c17b7013d730cd02639ef68770ff957f3f1f7d0e392d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f64646174652f64646174652e7376673f7374796c653d666c6174266c6162656c3d6c6963656e7365)](https://packagist.org/packages/ddate/ddate)[![Code Climate](https://camo.githubusercontent.com/371bb6086a79817f47fe2c1b7c41b03b4f5b000546323686c5a97bed07e28d41/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6477656963686572742f44646174652f6261646765732f6770612e737667)](https://codeclimate.com/github/dweichert/Ddate)[![SymfonyInsight](https://camo.githubusercontent.com/0ff90b60d4a48f12dc145d19387248bb9b5fa207d1be88740fe21d6604cbf54b/68747470733a2f2f696e73696768742e73796d666f6e792e636f6d2f70726f6a656374732f61646262303762632d656461612d346436652d613131332d3062373636646536363837612f6d696e692e737667)](https://insight.symfony.com/projects/adbb07bc-edaa-4d6e-a113-0b766de6687a)[![composer.lock](https://camo.githubusercontent.com/6ee206baf0aa7923c648fb7c9d517459e0825de614f460ba99ea9f946b0a15bf/68747470733a2f2f706f7365722e707567782e6f72672f64646174652f64646174652f636f6d706f7365726c6f636b)](https://packagist.org/packages/ddate/ddate)[![Gitmoji](https://camo.githubusercontent.com/405e2a9daa5c5af1ae14ef84d56aeab545a6a1c5f679831a83a5f5565f846493/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6769746d6f6a692d2546302539462539382539432546302539462539382538442d696e666f726d6174696f6e616c)](https://gitmoji.dev)

What is EmperorNortonCommands/lib/Ddate?
----------------------------------------

[](#what-is-emperornortoncommandslibddate)

EmperorNortonCommands/lib/Ddate is an almost faithful recreation of the ddate command formerly provided by the *util-linux* standard package of the Linux operating system in PHP. It converts Gregorian to Discordian dates.

Installation
------------

[](#installation)

The easiest way to use the library in your project is to install it by adding it as a dependency to your project's composer.json file.

```
$ composer require ddate/ddate "^1.1"

```

If you want to call the library via the command line or use it in a shell script downloading the [PHAR file](https://en.wikipedia.org/wiki/PHAR_(file_format)) from the [releases page](https://github.com/dweichert/Ddate/releases/latest) can be convenient. Everything is contained in a single file that can be called from the command line and you can pass parameters as command line arguments (see below for details). You can invoke *ddate* from the command line by executing the file in the directory to which it was downloaded:

```
$ ./ddate.phar

```

To show the help text and format string options use:

```
$ ./ddate.phar --help

```

If you specify a locale as a second argument the format string options (see below) for the given locale will be shown:

```
$ ./ddate.phar --help de

```

The releases are signed using the GPG-key with the ID `A6FED5506250B129` and the Fingerprint `F1F7 A70A 51E2 D0FA 0903 65B7 A6FE D550 6250 B129`

You can verify the PHAR file using these commmands:

```
$ gpg --keyserver pgp.mit.edu --recv-key 0xA6FED5506250B129
$ gpg --fingerprint A6FED5506250B129
$ gpg --verify ddate.phar.asc ddate.phar

```

Usage
-----

[](#usage)

```
// use the class Ddate

use EmperorNortonCommands\lib\Ddate;

class Foo
{
    public function foo()
    {
        // set $date to the current Discordian date using the default format
        $ddate = new Ddate();
        $date = $ddate->ddate();

        // for more formatting options and setting custom dates see below
    }
}

```

The method ddate() returns the date in Discordian date format. If called with no parameters, the current system date will be used.

### Parameters

[](#parameters)

If a format string is specified as the first parameter, the Discordian date will be returned in a format specified by the string. This mechanism works similarly to the format string mechanism of date(), only almost completely differently.

To show the Discordian date for another day, a Gregorian date may be specified as the second parameter of the function, in form of a day, month and year (dmY), e.g. 29022012 (for the 29th of February 2012).

The third parameter is a string serving as a locale identifier. Currently 'en' (for English) and 'de' (for German) are supported by standard formatters shipped with the library. English is the fallback should no locale be specified.

#### Examples

[](#examples)

```
$ddate->ddate('Today is %{%A, the %e of %B%}, %Y.%N %nCelebrate %H', 18092013)

```

*Today is Sweetmorn, the 42nd of Bureaucracy, 3179.*

```
$ddate->ddate("It's %{%A, the %e of %B%}, %Y. %N%nCelebrate %H", 26092013)

```

*It's Prickle-Prickle, the 50th of Bureaucracy, 3179.*

*Celebrate Bureflux*

```
$ddate->ddate("Today's %{%A, the %e of %B%}, %Y. %N%nCelebrate %H", 29022016)

```

*Today's St. Tib's Day, 3182.*

```
$ddate->ddate("Heute ist %{%A, %e %C%}, %Y. %N%nWir feiern %H", 29022020, "de")

```

*Heute ist St. Tibs Tag, 3186.*

```
$ddate->ddate("%2%4Heute ist %{%A, %e %C%}, %Y. %N%nWir feiern %H", 09012018, "de")

```

*Heute ist Prickel-Prickel, 9. der Verwirrung, 3184.*

```
$ddate->ddate("%2%4Heute ist %{%A, %e %C%}, %Y. %N%nWir feiern %H", 10012018, "de")

```

*Heute ist Orangewerdend, 10. der Verwirrung, 3184.*

*Wir feiern Rückwärtstag (reformiert) und Binärtag*

### Method getSupportedFormatStringFields

[](#method-getsupportedformatstringfields)

```
$ddate->getSupportedFormatStringFields()
$ddate->getSupportedFormatStringFields("de")

```

Will return an array of all supported format string fields. The keys of the returned array are the format fields supported in a format string and the values provide an English description of the fields purpose.

The first optional parameter allows to specify a locale identifier, because the format string fields are locale specific.

Releases
--------

[](#releases)

VersionSupported PHP VersionsRemarks2.0.x8.0.x1.1.x5.3.x, 5.4.x, 5.5.x, 5.6.x, 7.0.x, 7.1.x, 7.2.x, 7.3.x, 7.4.xOlder PHP versions will be supported as long as the CI builds can be maintained.\*1.0.x--Version 1.0.x has reached its end of life and is no longer supported.\* Regrettably HHVM is no longer supported, as [HHVM no longer supports PHP](https://hhvm.com/blog/2018/09/12/end-of-php-support-future-of-hack.html) and [Composer no longer runs under HHVM](https://hhvm.com/blog/2019/02/11/hhvm-4.0.0.html), rendering the HHVM build permanently broken. Older versions of HHVM/Composer used to work, but your milage may vary.

License
-------

[](#license)

This program is in the public domain. Distribute freely. Or not. See the file [LICENSE](LICENSE) for more details.

Hail Eris, All Hail Discordia,

Pope Rotund Deluxe

Bureflux, 3179

(last updated: Prickle-Prickle, 48th of The Aftermath, 3186)

###  Health Score

30

—

LowBetter than 61% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity66

Established project with proven stability

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 ~227 days

Recently: every ~643 days

Total

15

Last Release

756d ago

Major Versions

1.1.x-dev → 2.x-dev2024-07-20

PHP version history (2 changes)v1.0PHP &gt;=5.3.0

2.x-devPHP 8.3.\*

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2235895?v=4)[David Weichert](/maintainers/dweichert)[@dweichert](https://github.com/dweichert)

---

Tags

conversiondatecalendarddatediscordian

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[league/period

Time range API for PHP

7335.9M25](/packages/league-period)[aeon-php/calendar

PHP type safe, immutable calendar library

20910.6M16](/packages/aeon-php-calendar)[yohang/calendr

Object Oriented calendar management

467624.2k3](/packages/yohang-calendr)[umulmrum/holiday

A PHP library to compute holidays. It's something :-)

94401.1k1](/packages/umulmrum-holiday)[benhall14/php-calendar

A simple PHP class to generate calendars.

9929.2k](/packages/benhall14-php-calendar)[silverware/calendar

SilverWare Calendar Module.

1644.3k1](/packages/silverware-calendar)

PHPackages © 2026

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