var daystr=new Date().Format("yyyy-MM-dd HH:mm:ss");
var sql="select top 10 worksite,left(NeedDeal,45) as NeedDeal,UserCoName,gz from [WorkSite] where ToDate>‘"+daystr+"’ and stop=0 order by PDate desc";
错误提示
query: 'select top 10 worksite,left(NeedDeal,45) as NeedDeal,UserCoName,gz from [WorkSite] where ToDate>\'"2013-2-30 17:11"\' and stop=0 order by PDate desc'
} 调用:
var time1 = new Date().Format(“yyyy-MM-dd”); var time2 = new Date().Format(“yyyy-MM-dd HH:mm:ss”);
谢谢
还有个问题,就是字符串拼接 比如:
错误提示
变为’“2012-2-30 17:11”' 要怎么写啊?
@zcl521ss http://www.w3school.com.cn/js/jsref_obj_string.asp
@zcl521ss 推荐这个,moment, http://momentjs.com/ 有了这个,你还想用其他的吗?
moment.js 是正解
基本注入已完成,就差路径映射变量处理
发错
moment.js
moment.js
moment.js
https://github.com/felixge/node-dateformat
这个更简单一点
var nowDate = new Date(); var result = nowDate.toLocaleDateString() + " "+ nowDate.toLocaleTimeString();
moment+10086
moment.js
moment.js
moment.js
为什么 这个函数 作为单独一个模块 导出之后 在主文件里 显示 不是一个函数呢