Created
July 8, 2015 04:56
-
-
Save shamsher31/542905f83d29f8a302ea to your computer and use it in GitHub Desktop.
Javascript UTC time from Timestamp
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 getUTCTimeFromTimeStamp(timestamp) { | |
var currentTime = new Date(timestamp), | |
unixTime = new Date( | |
currentTime.getUTCFullYear(), | |
currentTime.getUTCMonth(), | |
currentTime.getUTCDate(), | |
currentTime.getUTCHours(), | |
currentTime.getUTCMinutes(), | |
currentTime.getUTCSeconds() | |
); | |
return unixTime.getTime(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment