zoukankan      html  css  js  c++  java
  • JS工具对象 DATE 方法

    1.获取当前电脑的系统时间   var time = new Date();

    var time = new Date();//获取当前系统时间
    console.log(time); // Mon Apr 03 2017 09:03:18 GMT+0800 (中国标准时间)

    2.获取当前年    time.getFullYear();

    var time = new Date();
    var year = time.getFullYear();
    console.log(year);//2017

    3.获取当前月   time.getMonth();

    var time = new Date();
    var month = time.getMonth();
    console.log(month); //3

    4.获取当前天 time.getDate();

    var time = new Date();
    var day = time.getDate();
    console.log(day);3

    5.获取当前 (0-6代表周日-周六)time.getDay();

    var time = new Date();
    var week = time.getDay();
    console.log(week); //  1  (结果 0-6 周日、周一、周二...周六 )

    6.获取当前时间(当前小时整点) time.getHours();

    var time = new Date();
    var hours = time.getHours();
    console.log("hours   "+hours);//  10

    7.获取当前分钟(分钟) time.getMinutes();

    var time = new date();
    var minutes = time.getMinutes();
    console.log(minutes); //34

    8.获取当前秒 time.getSeconds();

    var  time = new date();
    var  seconds = time.getSeconds();
    console.log(seconds);

    9.获取当前毫秒 time.getMilliseconds();

    var time = new Date();
    var mlSeconds = time.getMilliseconds();
    console.log("miSeconds       "+mlSeconds);//  519

    10.

  • 相关阅读:
    Falsk的模板分配和蓝图、定制错误信息、 和补充
    Flask配置文件和 路由系统
    初始Flask
    REST Framework组件的解析源码
    MdelForm 和formset
    待修改脚本
    时间打点脚本
    Move Over and Click Link
    Wait and Click Element
    Strings=newString(“xyz”);创建了几个 StringObject?
  • 原文地址:https://www.cnblogs.com/zzzzzzzsy/p/6661747.html
Copyright © 2011-2022 走看看