zoukankan      html  css  js  c++  java
  • JS 获取日期字符串

    效果图:

    代码:

     1                 var date = new Date();
     2                 var seperator1 = "-";
     3                 var seperator2 = ":";
     4                 var month = date.getMonth() + 1;
     5                 var strDate = date.getDate();
     6                 if (month >= 1 && month <= 9) {
     7                     month = "0" + month;
     8                 }
     9                 if (strDate >= 0 && strDate <= 9) {
    10                     strDate = "0" + strDate;
    11                 }
    12                 var currentdate = date.getFullYear() + month + strDate;
    13                 sweetAlert(currentdate.toString());
  • 相关阅读:
    css定位
    css盒子
    css元素分类
    Css属性
    Css基础2
    啊啊啊啊
    函数指针
    重载函数
    成员函数
    资源网站
  • 原文地址:https://www.cnblogs.com/xinyibufang/p/7246011.html
Copyright © 2011-2022 走看看