search

Home  >  Q&A  >  body text

angular.js - Please tell me about the timezone problem of date filter in angularjs

This is what I output now:
{{answer.time | date:'yyyy-MM-dd'}}
The result is output: 1970-01-18
The value of answer.time is Timestamp.

How can I display the date correctly?

大家讲道理大家讲道理2828 days ago539

reply all(2)I'll reply

  • 滿天的星座

    滿天的星座2017-05-15 17:01:58

    O, it turns out that the number of seconds I sent from the background should be changed to milliseconds

    reply
    0
  • PHP中文网

    PHP中文网2017-05-15 17:01:58

    js 处理 answer.time = new Date(answer.time)

    reply
    0
  • Cancelreply