Reputation: 3
Back End is Java. front end is Extjs js.
When I set date in Java script as set value (new Date ), current date comes up in UI. when I set using back-end value date component is empty. Date comes up as string of numbers of length 13 in UI when debug. Date. parse is not working. how do i set value in UI from back-end. date from back-end is Java util date.
Upvotes: 0
Views: 395
Reputation: 113
The 13 digit string of numbers you are talking about is Unix timestamp including milliseconds. You can convert the unix timestamp to whichever format you want at the frontend in ExtJS using format method of Ext.Date package.
let unix_time = 1527496785000;
let formatted_time = Ext.Date.format(new Date(unix_time), "Y-m-d H:i:s");
console.log(formatted_time) //2018-05-28 14:09:45
Upvotes: 2