zoukankan      html  css  js  c++  java
  • js-字符串转化日期

    endLogTimeDate = “2012-05-22 17:10:46”  
    startLogTimeDate = “2012-05-22 17:10:46var endLogTimeDate = new Date(Date.parse(endLogTimeDate.replace(/-/g, "/")));  
    var startLogTimeDate = new Date(Date.parse(startLogTimeDate.replace(/-/g, "/")));  
    日期的操作:  
    endLogTimeDate .getYear();        //获取当前年份(2位)  
    endLogTimeDate .getFullYear();    //获取完整的年份(4位,1970-????)  
    endLogTimeDate .getMonth();       //获取当前月份(0-11,0代表1月)  
    endLogTimeDate .getDate();        //获取当前日(1-31)  
    endLogTimeDate .getDay();         //获取当前星期X(0-6,0代表星期天)  
    endLogTimeDate .getTime();        //获取当前时间(从1970.1.1开始的毫秒数)  
    endLogTimeDate .getHours();       //获取当前小时数(0-23)  
    endLogTimeDate .getMinutes();     //获取当前分钟数(0-59)  
    endLogTimeDate .getSeconds();     //获取当前秒数(0-59)  
    endLogTimeDate .getMilliseconds();    //获取当前毫秒数(0-999)  
    endLogTimeDate .toLocaleDateString();     //获取当前日期  
    var mytime=endLogTimeDate .toLocaleTimeString();     //获取当前时间  
    endLogTimeDate .toLocaleString( );        //获取日期与时间  
  • 相关阅读:
    xlrd模块
    魔法路由ViewSetMixin
    AES加密
    orm的增删改查
    引入方式+样式+选择器
    视图+sql注入+事务+存储过程
    mysql用户管理+pymysql模块
    记录的详细操作
    约束
    一次http请求参数问题
  • 原文地址:https://www.cnblogs.com/hwaggLee/p/5207677.html
Copyright © 2011-2022 走看看