Created
December 2, 2022 21:30
-
-
Save yukiarimo/7dab7df8eeccbd146f605d05b57f87e4 to your computer and use it in GitHub Desktop.
Unix time converter
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 timeConverter(UNIX_timestamp){ | |
var a = new Date(UNIX_timestamp * 1000); | |
var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']; | |
var year = a.getFullYear(); | |
var month = months[a.getMonth()]; | |
var date = a.getDate(); | |
var hour = a.getHours(); | |
var time = date + ' ' + month + ' ' + year + ' ' + hour + ':' + '00' ; | |
return time; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment