Skip to content

Instantly share code, notes, and snippets.

@adamcrampton
Created October 30, 2018 01:31
Show Gist options
  • Save adamcrampton/64174e038fb74bcd73e1f330859df638 to your computer and use it in GitHub Desktop.
Save adamcrampton/64174e038fb74bcd73e1f330859df638 to your computer and use it in GitHub Desktop.
moment.js tester
// Requires moment.js
const moment = require('moment');
// Remove date parameter from moment method to get "now"
var formattedDate = moment('2018-10-29 13:57:37').format('h:mm A');
alert(formattedDate);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment