lavkach3
1var moment = require('./build/moment');2// var moment = require('./moment');
3// moment.config({
4// formatString: {
5// "r": "YYYY"
6// },
7// now:"2016-07-11T18:42:34.453+08:00"
8// });
9
10// console.log(moment());
11
12console.log(moment("2016-07-03").endOf(moment.MONTH).format("ff"))13// console.log(moment('2016-07-23').distance(moment(),moment.DAY))
14
15// console.log(moment().toString());
16// console.log(moment().format());
17// console.log(moment().format("l"));
18// console.log(moment().format("ll"));
19// console.log(moment().format("k"));
20// console.log(moment().format("kk"));
21// console.log(moment().format("kkk"));
22// console.log(moment().format("f"));
23// console.log(moment().format("ff"));
24// console.log(moment().format("fff"));
25// console.log(moment().format("n"));
26// console.log(moment().format("nn"));
27// console.log(moment().format("r"));
28
29// console.log(moment(1459235037).format());
30// console.log(moment(1459235037000).format());
31// console.log(moment([2016,11,23,4,3,5]).format("f"));
32// console.log(moment([2015,12,3]).format());
33// console.log(moment("2014-12-03").format("f"));
34// console.log(moment("2014-12-03 12:34").format("f"));
35// console.log(moment("2014-12-03 12:34:34").format("f"));
36// console.log(moment("20141203").format("f"));
37// console.log(moment("201412031223").format("f"));
38
39// console.log(moment().year(2018).format());
40// console.log(moment("2012-10-03 23:59:59").month(8).month());
41// console.log(moment().isLeapYear());
42
43// console.log(moment("2012-10-03 23:59:59").add(1,moment.DAY).format("ff"));
44// console.log(moment("2012-10-03 23:59:59").add(-1,moment.DAY).format("ff"));
45
46// console.log(moment("2012-10-03 23:59:59").add(26,moment.MONTH).format("ff"));
47// console.log(moment("2012-10-03 23:59:59").add(-1,moment.YEAR).format("ff"));
48// console.log(moment("2012-10-03 23:59:59").add(1,moment.MINUTE).format("ff"));
49
50// console.log(moment().startOf(moment.DAY).format("ff"));
51// console.log(moment("2012-10-03 23:59:59").startOf(moment.YEAR).format("ff"));
52// console.log(moment("2012-10-03 23:59:59").startOf(moment.MONTH).format("ff"));
53// console.log(moment().startOf(moment.HOUR).format("ff"));
54
55// console.log(moment("2012-10-03 23:59:59").endOf(moment.YEAR).format("fff"));
56// console.log(moment("2012-10-03 23:59:59").endOf(moment.MONTH).format("fff"));
57// console.log(moment("2016-07-22 ").distance(moment.NOW,moment.DAY));
58// console.log(moment())
59// console.log(moment('2016-07-22'))
60
61// console.log(moment("2012-10-03 23:59:59").startOf(moment.WEEK,moment.MONDAY).format("fff"))
62// console.log(moment("2012-10-03 23:59:59").endOf(moment.WEEK,moment.MONDAY).format("fff"))
63// console.log(moment().getWeekOfMonth(moment.MONDAY))
64// console.log(moment().format("f"))