将中文标准时间转换为标准格式的代码
周四8月222013 15:12:00 GMT + 0800(中国标准时间)转型
复制代码代码如下所示:
功能formatten(NUM){
返回值> 9(Num + ):(0);
}
功能formatDate(日期){
VaR年= date.getfullyear();
VaR月= date.getmonth()+ 1;
VaR天= date.getdate();
无功功率= date.gethours();
VaR分钟= date.getminutes();
无功二= date.getseconds();
年收益+-+ formatten(月)+-+ formatten(天);
}