115FXC

第一:是把生成的Json格式的时间转换,注意要看清楚时间的格式
function (cellval) {
var date = new Date(parseInt(cellval.replace("/Date(", "").replace(")/", ""), 10));
var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
var currentDate = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
var hour = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
var minute = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
var second = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
return date.getFullYear() + "/" + month + "/" + currentDate + " " + hour + ":" + minute + ":" + second;
}


*说明:cellval就是要转换的那个值,而且时间也要是Json格式的转换

 

第二:用js来日常获取时间

var today = new Date();//创建时间对象

var nowday = today.getFullYear() + "/" + (today.getMonth() + 1) + "/" + today.getDate() + " " + today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();

分类:

技术点:

相关文章:

  • 2022-01-26
  • 2021-11-19
  • 2021-11-28
  • 2022-02-18
  • 2022-12-23
  • 2021-12-22
  • 2021-12-22
  • 2021-11-28
猜你喜欢
  • 2022-01-18
  • 2021-09-09
  • 2021-11-09
  • 2022-12-23
  • 2022-01-08
  • 2022-12-23
相关资源
相似解决方案