【问题标题】:MomentJS date format as "2017-04-06T13:53"MomentJS 日期格式为“2017-04-06T13:53”
【发布时间】:2018-01-12 14:52:59
【问题描述】:

希望将日期时间值转换为以下格式

2017-04-06T13:53

谢谢

【问题讨论】:

标签: momentjs


【解决方案1】:

// Exactly your time format
console.log( moment().format( 'YYYY-MM-DDTHH:mm' ) );

// ISO8601 format
console.log( moment().format() );
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js"></script>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-15
    • 1970-01-01
    相关资源
    最近更新 更多