JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://datejs.googlecode.com/files/date.js"></script>
<div class="timestamp">2014-08-25 22:00:34 GMT</div>
<a href="#" target="_blank">Test</a>
JavaScript
jQuery.fn.extend({
test: function(format) {
return this.each(function(i, e) {
var txt = $(e).html();
//var date = new Date(txt);
//$(e).html ( date.format(format) );
var d1 = Date.parse(txt);
$(e).html(d1.toString('yyyy-MM-dd hh:mm:ss'));
//$(e).html (date.toString(''));
//$(e).html ( date.toISOString().substr(0, 19).replace('T', ' ') );
});
}
});
$(function() {
alert('test');
//var txt = $('.timestamp').html();
//var date = new Date(txt);
//alert(date.getDate() +'-' + date.getMonth() + '-' + date.getFullYear() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds() );
$('.timestamp').test('yyyy/mm/dd hh:mm:ss');
});