from unix timestamp to datetime

前端 未结 8 1020
日久生厌
日久生厌 2020-12-01 09:28

I have something like /Date(1370001284000+0200)/ as timestamp. I guess it is a unix date, isn\'t it? How can I convert this to a date like this: 31.05.201

8条回答
  •  死守一世寂寞
    2020-12-01 09:55

    if you're using React I found 'react-moment' library more easy to handle for Front-End related tasks, just import component and add unix prop:

    import Moment from 'react-moment'
    
     // get date variable
     const {date} = this.props 
    
     {date}
    

提交回复
热议问题