Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
175
rated 0 times [  182] [ 7]  / answers: 1 / hits: 78686  / 8 Years ago, tue, november 22, 2016, 12:00:00

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


More From » node.js

 Answers
25
moment.unix(yourUnixEpochTime).format('dddd, MMMM Do, YYYY h:mm:ss A')

[#59956] Monday, November 21, 2016, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
arthur

Total Points: 729
Total Questions: 107
Total Answers: 109

Location: China
Member since Mon, Aug 22, 2022
2 Years ago
;