Use Moment.js to convert Unix epoch time to human readable time

danny picture danny · Nov 22, 2016 · Viewed 50.2k times · Source

I'm trying to use Moment.js to convert a Unix epoch time to a date and time. I'd also like to know how to have it formatted like below.

Tuesday, November 22, 2016 6:00 PM

Answer

manonthemat picture manonthemat · Nov 22, 2016
moment.unix(yourUnixEpochTime).format('dddd, MMMM Do, YYYY h:mm:ss A')