Skip to content

Instantly share code, notes, and snippets.

@Luvgreed
Last active April 30, 2017 17:02
Show Gist options
  • Save Luvgreed/55da1a1100212eed3571beec514ac6e9 to your computer and use it in GitHub Desktop.
Save Luvgreed/55da1a1100212eed3571beec514ac6e9 to your computer and use it in GitHub Desktop.
var TheTime = moment();
l('year', TheTime.get('year'));
l('month', TheTime.get('month')+1);
l('date', TheTime.get('date'));
or
l('YYYY',moment().format('YYYY'));
l('MM',moment().format('MM'));
l('DD',moment().format('DD'));
var newTime = TheTime.subtract(1, 'year');
l('year', newTime.get('year'));
l('month', newTime.get('month')+1);
l('date', newTime.get('date'));
newTime.add(1, 'days');
l('year', newTime.get('year'));
l('month', newTime.get('month')+1);
l('date', newTime.get('date'));
// moment(req.body.profile.birthday, ["YYYY-MM-DD"]).toISOString()
// moment(req.body.start_at, ["YYYY-MM-DD HH:mm:ss"]).isValid()
// var start = moment().startOf('day'); // set to 12:00 am today
// var end = moment().endOf('day'); // set to 23:59 pm today
l('set date', new Date(2015, 6, 1));
l('set moment', moment([2015, 6, 1]).toISOString())
l('daysInMonth', moment([2017, 0]).daysInMonth());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment