Moment.js Include text in middle of date format

后端 未结 1 1891
一生所求
一生所求 2020-12-02 16:34

I have a format of \"Jan. 27, 2015 at 8:17 AM\" that I need to display using moment.js. I\'m using the format

moment.format(\'MMM. D, YYYY at h:mm A z\');
<         


        
相关标签:
1条回答
  • 2020-12-02 16:55

    Escape it with square braces

    moment().format('MMM. D, YYYY [at] h:mm A z');
    // produces:    "Jan. 30, 2015 at 2:46 PM "
    
    0 讨论(0)
提交回复
热议问题