2017-07-19 43 views
0

我从日期得到非常奇怪的数据,我只是不明白为什么?!?角度不转换unix日期,因为它应该

<b>{{ (lines.date*1000) | date:"dd-mm-yyyy" }}: </b> 

这里是我的线阵列中的数据:

"lines" : [ 
     { 
      "text" : "was CREATED Tue Jul 11 2017 from Booking.com: ThaiHome by ThaiHome Staff", 
      "date" : 1499754031 
     }, 
     { 
      "date" : 1499754031, 
      "text" : "wrote message: This is the message the NEW user writes to manager" 
     }, 
     { 
      "date" : 1499754140, 
      "text" : "wrote message: This is the message the NEW user writes to manager" 
     }, 
     { 
      "date" : 1499754140, 
      "text" : "wrote message: This is the message the NEW user writes to manager" 
     }, 

这里是输出

11-20-2017: was CREATED Tue Jul 11 2017 from Booking.com: ThaiHome by ThaiHome Staff 
11-20-2017: wrote message: This is the message the NEW user writes to manager 
11-22-2017: wrote message: This is the message the NEW user writes to manager 
11-22-2017: wrote message: This is the message the NEW user writes to manager 
11-22-2017: wrote message: This is the message the NEW user writes to manager 
11-24-2017: wrote message: This is the message the NEW user writes to manager 
11-24-2017: wrote message: This is the message the NEW user writes to manager 
11-24-2017: wrote message: This is the message the NEW user writes to manager 

为什么会出现这些奇怪的日期,而不是越来越平常实际日期?

回答

3

mm用于分钟,填充(00-59)。对于一个月,你可以使用下面的一个:

  • MMMM:本月年(一月至十二月)
  • MMM:本月年(一月至十二月)
  • MM:本月以来,填充( 01-12)
  • M:本月年(1-12)

Official reference

+0

Noooo真的吗?哈哈哈该死! - 我一直在为这个问题出汗一个小时,试图用数学哈哈解决它。我需要更好地看看它接受的令牌:-)感谢Prera​​k :-D – torbenrudgaard

+0

乐意帮忙:) –

+0

https://docs.angularjs.org/api/ng/filter/date - 它们都是:-D – torbenrudgaard