Javascript 如何使用moment.js从日期中删除年份?
我正在使用MomentJS显示日期Javascript 如何使用moment.js从日期中删除年份?,javascript,date,datetime,momentjs,date-formatting,Javascript,Date,Datetime,Momentjs,Date Formatting,我正在使用MomentJS显示日期 moment(startDate).format('lll') 将显示:2014年1月29日03:04 但我想取消“2014”这一年,我该怎么做 这是momentjs的链接 我以前没有使用过该库,但请尝试以下方法: moment(StartDate, "MMM DD HH:mm"); 至少这在.NET中是可行的。您需要的是: moment(startdate).format('MMM DD h:mm A'); 请参见javascript示例: 我看到的唯
moment(startDate).format('lll')
将显示:2014年1月29日03:04
但我想取消“2014”这一年,我该怎么做
这是momentjs的链接
我以前没有使用过该库,但请尝试以下方法:
moment(StartDate, "MMM DD HH:mm");
至少这在.NET中是可行的。您需要的是:
moment(startdate).format('MMM DD h:mm A');
请参见javascript示例:
我看到的唯一问题是OP使用了“lll”,这是区域设置感知的。上述答案并非如此。