Created
June 23, 2011 09:47
-
-
Save moluapple/1042262 to your computer and use it in GitHub Desktop.
Change System Time
This file contains hidden or 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
/*************************** | |
* 修改Windows系统时间 | |
* 用于运行超过时限无法运行的js | |
***************************/ | |
var d = new Date(); | |
var today ='date ' + [d.getFullYear(), d.getMonth()+1, d.getDate()].join('-'); | |
function changeDate(date, del){ | |
var filerf = new File ('setDate.bat'); | |
var flag = filerf.open ('w'); | |
filerf.write(date); | |
filerf.close(); | |
filerf.execute(); | |
$.sleep(500); | |
if (del) filerf.remove(); | |
} | |
changeDate('date 2010-5-1', 0); | |
/*do some thing here...e.g. | |
eval('@JSXBIN@[email protected]@...'); | |
*/ | |
changeDate(today, 1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment