Created
May 22, 2012 13:45
-
-
Save rwbaker/2769171 to your computer and use it in GitHub Desktop.
JavaScript: Unix time stamp 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
var myDate = 1337678451; | |
var date = new Date(myDate*1000); | |
var hrs = date.getHours(); | |
var min = date.getMinutes(); | |
var sec = date.getSeconds(); | |
var day = date.getDate(); | |
var month = date.getMonth(); | |
var year = date.getFullYear(); | |
console.log(month + '/' + day + '/' + year +' @ ' + hrs + ':' + min + ':' + sec); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment