Created
July 20, 2020 08:39
-
-
Save conr2d/38bed1e84ff1e4418358ae9468d84b41 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function timestampToDate(UNIX_timestamp) { | |
let a = new Date(UNIX_timestamp * 1000); | |
let months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']; | |
let year = a.getFullYear(); | |
let month = months[a.getMonth()]; | |
let date = a.getDate(); | |
let hour = a.getHours(); | |
let min = a.getMinutes(); | |
let sec = a.getSeconds(); | |
let time = date + ' ' + month + ' ' + year + ' ' + hour + ':' + min + ':' + sec ; | |
return time; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment