var myDate = new Date();
console.log(myDate.toLocaleString()); function getNowFormatDate() {
var date = new Date();
console.log(date);
var seperator1 = "-";
var seperator2 = ":";
var month = date.getMonth() + 1;
console.log(month);
var strDate = date.getDate();
console.log(strDate);
if (month >= 1 && month <= 9) {
month = "0" + month;
console.log(month);
}
if (strDate >= 0 && strDate <= 9) {
strDate = "0" + strDate;
console.log(strDate);
}
var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
+ " " + date.getHours() + seperator2 + date.getMinutes()
+ seperator2 + date.getSeconds(); console.log(date.getFullYear());
console.log(date.getHours());
console.log(date.getMinutes());
console.log(currentdate) ;
} getNowFormatDate();

  

最新文章

  1. Ural 1011. Conductors
  2. http错误码大全?
  3. s3c2440 移值u-boot-2016.03 第6篇 支持mtd yaffs 烧写
  4. hdu 1142 用优先队列实现Dijkstra
  5. HW5.27
  6. 使用 Node.js 做 Function Test
  7. 老李分享:jvm垃圾回收
  8. [leetcode-442-Find All Duplicates in an Array]
  9. Django进阶篇【2】
  10. 利用spring AOP实现每个请求的日志输出
  11. 一个特殊的SQL Server阻塞案例分析
  12. url传参过程中文字需编码、解码使用
  13. scott 本月报将收录移动Web加速技术的主要进展,欢迎读者一起完善,投稿邮箱:openweb@baidu.com
  14. 序列化与反序列化之JSON
  15. 解决 Ionic 浏览器跨域问题
  16. 【C语言天天练(三)】typedef具体解释
  17. IDEA破解教程
  18. idea中springboot项目程序入口右键不显示run as的原因
  19. matlab:inv,pinv逆与伪逆
  20. jQuery版本的jsonp

热门文章

  1. ubuntu上部署github博客,利用hexo
  2. chromium浏览器开发系列第二篇:如何编译最新chromium源码
  3. 智捷公开课马上开始了-欢迎大家一起讨论学习-第一系列读《Swift开发指南(修订版) 》看Swift视频教程
  4. iOS自定义NavigationBar
  5. hdu 2176 取(m)石子游戏
  6. Install GDAL in OpenSUSE 12.3 Linux
  7. JAVA多线程学习2--线程同步
  8. odoo8.0+PyCharm4.5开发环境配置
  9. SQL Server Management Studio Keyboard shortcuts
  10. 第六周 N题