PHPackages                             rzlco666/ostium-date - 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. rzlco666/ostium-date

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

rzlco666/ostium-date
====================

PHP Date Calculation and Formatting for Indonesian

v1.3(4y ago)0124MITPHPPHP &gt;=5.6.0

Since Jul 1Pushed 4y agoCompare

[ Source](https://github.com/rzlco666/OstiumDate)[ Packagist](https://packagist.org/packages/rzlco666/ostium-date)[ Docs](https://github.com/rzlco666/OstiumDate)[ RSS](/packages/rzlco666-ostium-date/feed)WikiDiscussions master Synced today

READMEChangelog (3)DependenciesVersions (5)Used By (0)

OstiumDate
==========

[](#ostiumdate)

Perhitungan dan Pemformatan Tanggal PHP untuk Bahasa Indonesia

Deskripsi
---------

[](#deskripsi)

**OstiumDate** adalah sebuah library perhitungan dan pemformatan tanggal yang diperuntukkan khusus untuk Bahasa Indonesia. Fungsi perhitungan tanggal pada library ini menggunakan fungsi bawaan PHP yang disederhanakan agar lebih mudah digunakan.

How-to-install
--------------

[](#how-to-install)

Menggunakan composer

```
composer require rzlco666/ostium-date

```

How-it-works
------------

[](#how-it-works)

Buat object untuk class OstiumDate

```
$od = new OstiumDate();

```

Mencetak tanggal dengan tampilan lengkap:

```
$od->fullDate() # argumen kosong menampilkan hari ini
# Output: Rabu, 13 Juni 2018

$od->fullDate('', '', '', false) # menampilkan hari ini tanpa disertai nama hari
# Output: 13 Juni 2018

$od->fullDate(2, 3, 2017)
# Output: Kamis, 2 Maret 2017

```

Mencetak tanggal dengan tampilan ringkas:

```
$od->shortDate() # argumen kosong menampilkan hari ini denga pemisah tanggal default '-'
# Output: 13-06-2018

$od->shortDate(2, 3, 2017, '/') # dengan pemisah tanggal sesuai input
# Output: 02/03/2017

```

Mencetak tanggal dengan *custom format:*

```
Format tanggal khusus dengan pilihan format d, D, DD, m, M, MM, Y
Contoh: 'd' = 26, 'D' = Sen, 26, 'DD' = Senin, 26
        'm' = 12, 'M' = Des, MM = Desember, y atau Y = 2016

Contoh eksekusi:
$od->format('D-M-Y', '1-9-2016', '-')
# Output: Kam, 1-Sep-2016

$od->format('DD-MM-Y', '1-9-2016', '-')
# Output: Kamis, 1-September-2016

$od->format('d-MM-Y', '1-9-2016') # dengan pemisah tanggal default menggunakan spasi
# Output: 1 September 2016

```

Menambahkan jumlah hari/bulan/tahun:

```
# Menambahkan 4 hari dari hari ini
$add = $od->add('now', 4);
echo $od->format('DD-MM-Y', $add);
# Output: Minggu, 17 Juni 2018

# Menambahkan 3 bulan 10 hari dari tanggal 1 Januari 2012
$add = $od->add('01-01-2012', ['m' => 3, 'd' => 10]);
echo $od->format('DD-MM-y', $add);
# Output: Rabu, 11 April 2012

# Menambahkan 2 tahun 3 bulan 10 hari dari tanggal 1 Januari 2012
$add = $od->add('01-01-2012', ['y' => 2, 'm' => 3, 'd' => 10]);
echo $od->format('DD-MM-y', $add);
# Output: Jumat, 11 April 2014

```

Mengurangi jumlah hari/bulan/tahun:

```
# Mengurangi 4 hari dari hari ini
$sub = $od->sub('now', 4);
echo $od->format('DD-MM-Y', $sub);
# Output: Sabtu, 9 Juni 2018

# Mengurangi 3 bulan 10 hari dari tanggal 1 Januari 2012
$sub = $od->sub('01-01-2012', ['m' => 3, 'd' => 10]);
echo $od->format('DD-MM-y', $sub);
# Output: Rabu, 21 September 2011

# Mengurangi 2 tahun 3 bulan 10 hari dari tanggal 1 Januari 2012
$sub = $od->sub('01-01-2012', ['y' => 2, 'm' => 3, 'd' => 10]);
echo $od->format('DD-MM-y', $sub);
# Output: Senin, 21 September 2009

```

Menghitung selisih hari/bulan/tahun:

```
Tipe output:
'pn-days' = positive-negative days, menghasilkan format output '%R%a hari'
'total-days' = '%a hari'
'num-only' = '%a'
'month' = '%m bulan'
'year' = '%y tahun'
'y-m-d' = '%y tahun, %m bulan, %d hari'
'm-d' = '%m bulan, %d hari'
'y-d' = '%y tahun, %d hari'
'y-m' = '%y tahun, %m bulan'

```

Detil format:
Eksekusi:

```
echo $od->diff('01-01-2013', '02-05-2015', 'pn-days', 'a-b');
# Output: +121 hari

echo $od->diff('01-01-2013', '02-05-2015', 'pn-days', 'b-a');
# Output: -121 hari

echo $od->diff('01-01-2013', '02-05-2015', 'total-days');
# Output: 121 hari

echo $od->diff('01-01-2013', '02-05-2015', 'y-m-d');
# Output: 2 tahun, 4 bulan, 1 hari

```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.4% 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 ~0 days

Total

4

Last Release

1464d ago

### Community

Maintainers

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

---

Top Contributors

[![adnzaki](https://avatars.githubusercontent.com/u/24837286?v=4)](https://github.com/adnzaki "adnzaki (20 commits)")[![rzlco666](https://avatars.githubusercontent.com/u/62584843?v=4)](https://github.com/rzlco666 "rzlco666 (8 commits)")

---

Tags

formatterdateindonesiabahasa

### Embed Badge

![Health badge](/badges/rzlco666-ostium-date/health.svg)

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

###  Alternatives

[sastrawi/sastrawi

PHP library for stemming Indonesian language (Bahasa Indonesia)

44077.6k3](/packages/sastrawi-sastrawi)[kartik-v/php-date-formatter

A Javascript datetime formatting and manipulation library using PHP date-time formats.

461.6M3](/packages/kartik-v-php-date-formatter)

PHPackages © 2026

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