how do i format javascript date like ISO format but local time?
with myDate.toISOString()I get the time like: "2012-09-13T19: 12: 23.826Z"
but here, it's 22:13, so how do I include the time zone in the above format?
I finished doing ...
pad=function(e,t,n){n=n||"0",t=t||2;while((""+e).length<t)e=n+e;return e}
c = new Date()
c.getFullYear()+"-"+pad(c.getMonth()+1)+"-"+pad(c.getDate()-5)+"T"+c.toLocaleTimeString().replace(/\D/g,':')+"."+pad(c.getMilliseconds(),3)
source
share