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.
The latest release of the library is v1.3.6. Check the CHANGE LOG for details.
- Read date/time strings or a Date object, and format it as per a PHP DateTime format.
- With release v1.3.2 the library has been converted to use pure javacript code without dependency on jQuery or other third party JS library.
Documentation and Demo
View the library documentation and
library demos at Krajee JQuery plugins.
You can use the
bower package manager to install. Run:
bower install php-date-formatter
You can use the
composer package manager to install. Either run:
$ php composer.phar require kartik-v/php-date-formatter "@dev"
to your composer.json file
You can also manually install the plugin easily to your project. Just download the source
TAR ball and extract the
plugin assets (css and js folders) into your project.
Step 1 Load the following assets in your header.
Step 2 You can now access the library using the
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');
php-date-formatter is released under the BSD 3-Clause License. See the bundled
LICENSE.md for details.