JavaScript How to show date correctly in react? [duplicate]

This question already has answers here:
Answer:1

You missed the new before Date(date) Also, maybe try multiplying that value by 100

<Feed.Date>{new Date(date*100)}</Feed.Date> 
Answer:2

I think that you can use the format function to help you with this.

Date.prototype.format = function(format)
{
 var o = {
 "M+" : this.getMonth()+1, //month
 "d+" : this.getDate(),    //day
 "h+" : this.getHours(),   //hour
 "m+" : this.getMinutes(), //minute
 "s+" : this.getSeconds(), //second
 "q+" : Math.floor((this.getMonth()+3)/3),  //quarter
 "S" : this.getMilliseconds() //millisecond
 }
 if(/(y+)/.test(format)) format=format.replace(RegExp.$1,
 (this.getFullYear()+"").substr(4 - RegExp.$1.length));
 for(var k in o)if(new RegExp("("+ k +")").test(format))
 format = format.replace(RegExp.$1,
 RegExp.$1.length==1 ? o[k] :
 ("00"+ o[k]).substr((""+ o[k]).length));
 return format;
}
Answer:3

Try adjusting your code like so:

<Feed.Date>{ new Date(date) }</Feed.Date> 

By creating a date object (via new), you can simplify conversion from UTC epoch time (ie the value of date) into a human readable date string.

For more information on Date, see this MDN article

Answer:4

I'm struggling with ui-router configuration which will define basic CRUD in the application. I need to be able to add, remove, edit and search for, say, clients. Quite basic task. Main page with ...

I'm struggling with ui-router configuration which will define basic CRUD in the application. I need to be able to add, remove, edit and search for, say, clients. Quite basic task. Main page with ...

I am a student and very new to JS, like this is my first project dealing with it. With that being said, please excuse how juvenile my coding may seem to you experts. I followed the instructions of my ...

I am a student and very new to JS, like this is my first project dealing with it. With that being said, please excuse how juvenile my coding may seem to you experts. I followed the instructions of my ...

I'm trying to iterate over a simple array using recursion. For this specific case, I'm trying to recreate .map() using recursion (without using .map()!. I currently am only pushing the last element ...

I'm trying to iterate over a simple array using recursion. For this specific case, I'm trying to recreate .map() using recursion (without using .map()!. I currently am only pushing the last element ...

  1. two dimensional array iteration in java
  2. 2 dimensional array iteration
  3. two dimensional array iteration
  4. javascript two dimensional array iteration
  5. c# two dimensional array iteration
  6. php multidimensional array iteration

Consider a matrix B= [[6,4,1,2], [5,3,9,7],[1,3,2,1]];. B is a matrix with three rows and four columns. I want to treat it as an array or a vector, namely B1=[6,4,1,2,5,3,9,7,1,3,2,1]. Moreover, I ...

Consider a matrix B= [[6,4,1,2], [5,3,9,7],[1,3,2,1]];. B is a matrix with three rows and four columns. I want to treat it as an array or a vector, namely B1=[6,4,1,2,5,3,9,7,1,3,2,1]. Moreover, I ...

  1. transform matrix into vector matlab
  2. transform matrix into dataframe r
  3. transform matrix into diagonal form
  4. transform matrix into upper triangular form
  5. transform matrix into vector
  6. transform matrix into jordan canonical form
  7. transform matrix into vector r
  8. transform matrix into column excel
  9. transform matrix into reduced echelon form
  10. transform matrix into row echelon form
  11. transform matrix into vector python
  12. transform matrix into positive definite
  13. transform matrix into dataframe
  14. transform matrix into vector excel
  15. transform matrix into dataframe python
  16. transform matrix into table matlab
  17. transform matrix into list python
  18. transform matrix into list
  19. transform matrix into upper triangular
  20. transform matrix in css