Skip to content

Instantly share code, notes, and snippets.

@ydnax
Created April 12, 2011 15:52
Show Gist options
  • Save ydnax/915781 to your computer and use it in GitHub Desktop.
Save ydnax/915781 to your computer and use it in GitHub Desktop.
var todate=function locToUtc(timestring){
var time=new Date(timestring);
var ms=time.getMilliseconds();
var s=time.getSeconds();
var mi=time.getMinutes();
var h=time.getHours();
var mo=time.getMonth();
var yr=time.getYear();
var newtime=new Date();
newtime.setUtcMilliseconds(,s);
newtime.setUtcSeconds(s);
newtime.setUtcMinutes(mi);
newtime.setUtcHours(h);
newtime.setUtcMonth(mo);
newtime.setUtcYear(yr);
return newtime;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment