Reputation: 2535
I have converted a feed's published date "pubDate" to integer using JS. Here is the code I used for it.
function timetoint(date){
var date = new Date(date);
return Math.round(date.getTime()/1000);
}
Now I need to convert the result of the above function back to a time format. How can I do it?
Upvotes: 0
Views: 4936
Reputation: 382304
Use the Date constructor :
var date = new Date(time*1000);
Upvotes: 4