| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | 2x 2x | const months = [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ]; export const getTimestamp = timestamp => { const _date = new Date(parseInt(timestamp, 10)); const date = _date.getDate(); const month = months[_date.getMonth()]; const year = _date.getFullYear(); const time = `${_date.getHours()}:${`0${_date.getMinutes()}`.slice(-2)}`; return `${date} ${month} ${year}, ${time}`; }; |