This repository has been archived on 2025-09-03. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
resolver/playground/moment-examples.js
2017-07-06 11:20:18 +04:30

17 lines
465 B
JavaScript

var moment = require('moment');
console.log(moment().format());
// January 1st 1970 @ 12:00am -> 0
// January 1st 1970 @ 12:01am -> -60
var now = moment();
console.log('Current timestamp', now.unix());
var timestamp = 1459111648;
var currentMoment = moment.unix(timestamp);
console.log('current moment', currentMoment.format('MMM D, YY @ h:mm a'));
// January 3rd, 2016 @ 12:13 AM
console.log('current moment', currentMoment.format('MMMM Do, YYYY @ h:mm A'));