Skip to content
Advertisement

Display time from string timestamp in javascript

I am trying to display the date from time stamp using JavaScript but not working please check my code and it’s not working due to string time but if i passed in number then it’s working but this time coming from API so i must need to do something here. can anyone please help me.

JavaScript

Advertisement

Answer

Parse string into int then…:

JavaScript

and use date object

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement