//时间格式转为时间戳 function sjc(){ var date = new Date(); //时间对象 var str = date.getTime(); //转换成时间戳 } //时间戳转换成时间 function time1(tm){ // 1.转换成 2015-7-18 下午4:50:43 格式: var tt=new Date(tm).toLocaleString().replace(/\//g, "-"); return tt; } function time2(…
date的详细用户可以参考下面的 http://www.cnblogs.com/xd502djj/archive/2010/12/29/1919478.html date 的具体用法可以查看另外一篇博文 <shell date 命令详解>http://blog.csdn.net/runming918/article/details/7223520 date +%s 可以得到UNIX的时间戳;用shell将时间字符串与时间戳互转: date -d "2010-10-18…