JSFiddle - React, Tailwind, and code Playground

by insin

HTML

<script src="https://raw.github.com/insin/newforms/master/src/time.js"></script>

JavaScript

// If I have a object with a date value formatted like 2011-05-07 02:41:43, // how can I convert it to format like Sun Jun 19 2011 12:36:45

// Example using https://raw.github.com/insin/newforms/master/src/time.js

var date = time.strpdate('2011-05-07 02:41:43', '%Y-%m-%d %H:%M:%S');
alert(time.strftime(date, '%a %b %d %Y %H:%M:%S'));