PHPackages                             kartik-v/php-date-formatter - 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. kartik-v/php-date-formatter

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

kartik-v/php-date-formatter
===========================

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

v1.3.7(1y ago)471.6M↓52.8%433BSD-3-ClauseJavaScript

Since Oct 5Pushed 1y ago6 watchersCompare

[ Source](https://github.com/kartik-v/php-date-formatter)[ Packagist](https://packagist.org/packages/kartik-v/php-date-formatter)[ Docs](https://github.com/kartik-v/php-date-formatter)[ RSS](/packages/kartik-v-php-date-formatter/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (9)DependenciesVersions (10)Used By (3)

 [ ![Krajee Logo](https://camo.githubusercontent.com/4addfbb3869c3fc7d79befea4f06d9cf3655a686fb503df0da1d725859cfdef9/687474703a2f2f6b617274696b2d762e6769746875622e696f2f626f6f7473747261702d66696c65696e7075742d73616d706c65732f73616d706c65732f6b72616a65652d6c6f676f2d622e706e67) ](http://plugins.krajee.com "Krajee Plugins")
 php-date-formatter ---

 [ ![Donate](https://camo.githubusercontent.com/4af77d425ca202e55ab3d711b438e238ded194735bc345a019ac060e03e26227/687474703a2f2f6b617274696b2d762e6769746875622e696f2f626f6f7473747261702d66696c65696e7075742d73616d706c65732f73616d706c65732f646f6e6174652e706e67) ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DTP3NZQ6G2AYU "Donate via Paypal")
==========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#------------------------php-date-formatter--------------------)

[![Bower version](https://camo.githubusercontent.com/f189050eabc87842442d0ce29f64227861c56510fe53b3fc8b953628c96cc94a/68747470733a2f2f62616467652e667572792e696f2f626f2f7068702d646174652d666f726d61747465722e737667)](http://badge.fury.io/bo/php-date-formatter)[![Stable Version](https://camo.githubusercontent.com/0fcae8a982a8dd815193eeb1a9f031d0dadc226b593a1e276463663b974c7bae/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f7068702d646174652d666f726d61747465722f762f737461626c65)](https://packagist.org/packages/kartik-v/php-date-formatter)[![Unstable Version](https://camo.githubusercontent.com/635bc410251060adc74b59c2118198cbda2a553f7a8c6154a36efff51f5ce75a/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f7068702d646174652d666f726d61747465722f762f756e737461626c65)](https://packagist.org/packages/kartik-v/php-date-formatter)[![License](https://camo.githubusercontent.com/83a8c2e8af8228a0752afb18a04909d3879e3eeac18d08eb7f674863ae757528/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f7068702d646174652d666f726d61747465722f6c6963656e7365)](https://packagist.org/packages/kartik-v/php-date-formatter)[![Packagist Downloads](https://camo.githubusercontent.com/4e5851a9ebfc7069d6538fae8b1482cdb7aeee933294c61a64f474729af8cd79/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f7068702d646174652d666f726d61747465722f646f776e6c6f616473)](https://packagist.org/packages/kartik-v/php-date-formatter)[![Monthly Downloads](https://camo.githubusercontent.com/e37d4d2602e31b3c2831838bc6257bff8be1de07227a30b1b08c7a1a9a6af70b/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f7068702d646174652d666f726d61747465722f642f6d6f6e74686c79)](https://packagist.org/packages/kartik-v/php-date-formatter)

A Javascript datetime library that allows you to manipulate date/times using PHP date-time formats in javascript. This library was built with an intention to read and write date/timestamps to the database easily when working with PHP server code. Use cases for this library would involve reading and saving a timestamp to database in one format, but displaying it on client or html forms in another format. Maintaining a consistent PHP Date time format for both server side and client side validation should help in building extensible applications with various PHP frameworks easily.

This library is a standalone javascript library and does not depend on other libraries or plugins like jQuery.

Check the [CHANGE LOG](https://github.com/kartik-v/php-date-formatter/blob/master/CHANGE.md) for release details.

Features
--------

[](#features)

- Parse date/time strings or a Date object, and convert it into Javascript Date Object by passing any of the [PHP DateTime formats](http://php.net/manual/en/function.date.php).
- Automatically guess date/time strings, even if it does not exactly match the format, and convert it into Javascript Date Object.
- Read date/time strings or a Date object, and format it as per a [PHP DateTime format](http://php.net/manual/en/function.date.php).
- With release v1.3.2 the library has been converted to use pure javascript code without dependency on jQuery or other third party JS library.

Documentation and Demo
----------------------

[](#documentation-and-demo)

View the [library documentation](http://plugins.krajee.com/php-date-formatter) and [library demos](http://plugins.krajee.com/php-date-formatter/demo) at Krajee JQuery plugins.

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

[](#installation)

### Using Bower

[](#using-bower)

You can use the `bower` package manager to install. Run:

```
bower install php-date-formatter

```

### Using Composer

[](#using-composer)

You can use the `composer` package manager to install. Either run:

```
$ php composer.phar require kartik-v/php-date-formatter "@dev"

```

or add:

```
"kartik-v/php-date-formatter": "@dev"

```

to your composer.json file

### Manual Install

[](#manual-install)

You can also manually install the plugin easily to your project. Just download the source [ZIP](https://github.com/kartik-v/php-date-formatter/zipball/master) or [TAR ball](https://github.com/kartik-v/php-date-formatter/tarball/master) and extract the plugin assets (css and js folders) into your project.

Usage
-----

[](#usage)

**Step 1** Load the following assets in your header.

```

```

**Step 2** You can now access the library using the `DateFormatter` object. For example, you can convert any date string to javascript date object for a specific PHP date format.

```
var fmt = new DateFormatter();
var date1 = fmt.parseDate('23-Sep-2013 09:24:12', 'd-M-Y H:i:s');
var date2 = fmt.formatDate(date1, 'd-F-Y h:i:s A');
```

License
-------

[](#license)

**php-date-formatter** is released under the BSD 3-Clause License. See the bundled `LICENSE.md` for details.

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity54

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 97.3% 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 ~472 days

Recently: every ~833 days

Total

9

Last Release

557d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3592619?v=4)[Kartik Visweswaran](/maintainers/kartik-v)[@kartik-v](https://github.com/kartik-v)

---

Top Contributors

[![kartik-v](https://avatars.githubusercontent.com/u/3592619?v=4)](https://github.com/kartik-v "kartik-v (36 commits)")[![saxenaakansha30](https://avatars.githubusercontent.com/u/30533290?v=4)](https://github.com/saxenaakansha30 "saxenaakansha30 (1 commits)")

---

Tags

phpformatterjavascriptdatetimetimedatephp-date-formatter.js

### Embed Badge

![Health badge](/badges/kartik-v-php-date-formatter/health.svg)

```
[![Health](https://phpackages.com/badges/kartik-v-php-date-formatter/health.svg)](https://phpackages.com/packages/kartik-v-php-date-formatter)
```

###  Alternatives

[dater/dater

Compact PHP library for working with date/time in different formats &amp; timezones.

14284.8k](/packages/dater-dater)[zjkal/time-helper

一个简单快捷的PHP日期时间助手类库。 a smart PHP datetime helper library.

21032.4k2](/packages/zjkal-time-helper)[danielstjules/php-pretty-datetime

Generates human-readable strings for PHP DateTime objects

58101.6k](/packages/danielstjules-php-pretty-datetime)[advmaker/carbon-period

Extension of nesbot/carbon plugin, to work with date period

12116.9k](/packages/advmaker-carbon-period)

PHPackages © 2026

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