随笔分类 - JS 对时间的处理
摘要:formatSeconds: function(value) { let that = this; var chetheTime = parseInt(value); // value是时间戳 var timestamp = (new Date()).getTime(); var date3 = chetheTime - timestamp; //计算出相差天数 var days = Math.f
阅读全文
摘要:this.addMinutes(new Date(Date.parse("2018-03-29 11:55")),5) //计算后n分钟的时间 addMinutes:function (date, minutes){ minutes=parseInt(minutes); var interTimes
阅读全文
摘要:var curTime = new Date(); //2把字符串格式转换为日期类 var startTime = new Date(Date.parse("2018-3-28 16:44")); var endTime = new Date(Date.parse("2018-3-28 16:45"
阅读全文
摘要:data: { weekdays:['','','','','','',''] }, onLoad: function (options) { let that = this; let now = new Date(); let today = now.getFullYear() + '-' + (
阅读全文
摘要:var now = new Date(); let today = now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate();//2018-3-27 var nowDayOfWeek = now.getDay(); co
阅读全文
摘要:js文件 'use strict'; let choose_year = null, choose_month = null; const conf = { data: { hasEmptyGrid: false, showPicker: false }, onLoad() { const date
阅读全文
摘要:// "2017/10/1 00:00" kaiShi: function (a) { var that = this; function nowTime() { var dateTime = new Date(); var timestamp = Date.parse(new Date()); v
阅读全文
摘要:js中获取时间new date()的用法 获取时间: 1 var myDate = new Date();//获取系统当前时间 获取特定格式的时间: 1 myDate.getYear(); //获取当前年份(2位) 2 myDate.getFullYear(); //获取完整的年份(4位,1970-
阅读全文