JSFiddle - React, Tailwind, and code Playground
by timrwood
HTML
<script src="https://raw.github.com/timrwood/moment/1.5.0/moment.js"></script>
CSS
p {
margin: 20px;
padding: 10px;
background: #eee;
color: #666;
font-family: Helvetica, Arial, sans-serif;
}
JavaScript
function print(a) {
$('body').append('<p>' + a + '</p>');
}
print("moment().format()");
print(moment('2011-10-10').format('H Z'));
print(moment('2011-10-10T10').format('H Z'));
print(moment('2011-10-10T10:00').format('H Z'));
print(moment('2011-10-10T10:00:00').format('H Z'));
print(moment('2011-10-10T10:00:00+00:00').format('H Z'));
print("moment().utc().format()");
print(moment('2011-10-10').utc().format('H Z'));
print(moment('2011-10-10T10').utc().format('H Z'));
print(moment('2011-10-10T10:00').utc().format('H Z'));
print(moment('2011-10-10T10:00:00').utc().format('H Z'));
print(moment('2011-10-10T10:00:00+00:00').utc().format('H Z'));
print("moment.utc().format()");
print(moment.utc('2011-10-10').format('H Z'));
print(moment.utc('2011-10-10T10').format('H Z'));
print(moment.utc('2011-10-10T10:00').format('H Z'));
print(moment.utc('2011-10-10T10:00:00').format('H Z'));
print(moment.utc('2011-10-10T10:00:00+00:00').format('H Z'));
print("moment.utc().local().format()");
print(moment.utc('2011-10-10').local().format('H Z'));
print(moment.utc('2011-10-10T10').local().format('H Z'));
print(moment.utc('2011-10-10T10:00').local().format('H Z'));
print(moment.utc('2011-10-10T10:00:00').local().format('H Z'));
print(moment.utc('2011-10-10T10:00:00+00:00').local().format('H Z'));