Created
November 24, 2015 10:34
-
-
Save Silambarasann/8acc9ace3534392326d2 to your computer and use it in GitHub Desktop.
Convert server time to local time javascript
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 convertTime(serverdate) { | |
var date = new Date(serverdate); | |
// convert to utc time | |
var toutc = date.toUTCString(); | |
//convert to local time | |
var locdat = new Date(toutc + " UTC"); | |
return locdat; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment