var nowDate = new Date();var year = nowDate.getFullYear();

 var month = nowDate.getMonth() +  <  ? "" + (nowDate.getMonth() + ): nowDate.getMonth() + ;

 var day = nowDate.getDate() <  ? "" + nowDate.getDate() : nowDate.getDate();

  var hours = nowDate.getHours()<?"" + nowDate.getHours():nowDate.getHours();
var minutes = nowDate.getMinutes()<?"" + nowDate.getMinutes():nowDate.getMinutes();
var seconds = nowDate.getSeconds()<?"" + nowDate.getSeconds():nowDate.getSeconds(); var dateStr = year + "-" + month + "-" + day+ " " + hours+ ":" + minutes+ ":" + seconds;
console.log(dateStr);

这是结果

我要转html5和js,哎,其实还挺喜欢写后端的,但是希望自己转变一下,加油吧

最新文章

  1. mybatis输出SQL
  2. 一个类似backbone路由的纯净route ( 前端路由 客户端路由 backbone路由 )
  3. 树莓派USB摄像头与camera模块对比
  4. 纯CSS仿windows系统loading效果
  5. (medium)LeetCode 222.Count Complete Tree Nodes
  6. word编号库中找不到带圈编号“①②③......&quot;了怎么办?
  7. http学习笔记一
  8. lightoj 1236 正整数唯一分解定理
  9. js分页代码
  10. 创建Activity
  11. Codeforces Round #246 (Div. 2) —B. Football Kit
  12. 每日算法37:Rotate Image (图像旋转)
  13. 8.2 sikuli 集成进eclipse 报错:Getting the VisionProxy.dll: Can not find dependent libraries...
  14. [算法] kmp实现
  15. Java加密解密字符串
  16. 配置SSH三大框架报错
  17. 20175316盛茂淞 2018-2019-2《Java程序设计》结对编程项目-四则运算 第二周(6)
  18. ajax请求头加Token时发生的跨域(CORS)请求问题
  19. Django-website 程序案例系列-4 ORM数据库操作
  20. PCIe 复位:Clod reset、warm reset、Hot reset、Function level reset

热门文章

  1. JavaScript-跨浏览器事件处理程序(EventUtil)
  2. 《京东B2B业务架构演变》阅读
  3. 每天进步一点点------Modelsim添加Xilinx仿真库的详细步骤
  4. upload-labs打关详解
  5. java面试记录二:spring加载流程、springmvc请求流程、spring事务失效、synchronized和volatile、JMM和JVM模型、二分查找的实现、垃圾收集器、控制台顺序打印ABC的三种线程实现
  6. 2020牛客寒假算法基础集训营1 I-nico和niconiconi
  7. Mapped Statements collection does not contain value for xxx
  8. 【手抖康复训练1 】Codeforces Global Round 6
  9. Pytest学习9-常用插件
  10. Angular 相关概念