代码如下:

changeDate1(e) {
console.log(e);
var date = new Date(e.detail.value);
console.log(date);
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const hour = date.getHours()
const minute = date.getMinutes()
const second = date.getSeconds()
const formatNumber = n => {
n = n.toString()
return n[1] ? n : '0' + n
}
var dateString = [year, month, day].map(formatNumber).join('-') + ' ' + [hour, minute, second].map(formatNumber).join(':')
console.log(dateString);
this.QueryParams.pestDate = dateString
this.setData({
'material.pestDate': e.detail.value
});
},

最新文章

  1. POJ 1860(spfa)
  2. all ,any,abs的使用
  3. 19Mybatis_订单商品数据模型分析
  4. mysql delete删除记录数据库空间不减少问题解决方法
  5. C语言调用Lua函数
  6. 锋利的jQuery第2版学习笔记1~3章
  7. Mysql一主多从和读写分离配置简记
  8. Delphi中的GetEnumName和GetEnumValue的使用方法
  9. IOS 学习笔记 2015-04-15 控制器数据反向传值
  10. demo_06Canvas
  11. Sql(in与exists)
  12. 线下市场,选择微信小程序从未显得如此重要
  13. SerialPort如何读取串口数据并显示在TextBox上,多线程委托
  14. ORACLE DB TRIGGER详解
  15. python 关于操作文件的相关模块(os,sys,shutil,subprocess,configparser)
  16. markdown自动生成侧边栏TOC /目录
  17. java抽象类详解
  18. thumbs.db是什么文件
  19. linux下zip包处理
  20. 杂项:TMT(数字媒体产业)

热门文章

  1. o2,o3优化
  2. Codeforces Round #643 (Div. 2) C. Count Triangles (数学公式)
  3. ansible的Ad-hoc命令
  4. LINUX - 寄存器和堆栈
  5. Leetcode(25)- k个一组翻转链表
  6. 关于rand()
  7. codeforce 849B
  8. 2019牛客多校第九场B Quadratic equation(二次剩余定理)题解
  9. HDU 3949 XOR (线性基第k小)题解
  10. Gym 101170I Iron and Coal(BFS + 思维)题解